WebGL Dialogue scale problem

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
DryreL
Posts: 29
Joined: Sat Dec 26, 2020 1:58 pm

WebGL Dialogue scale problem

Post by DryreL »

Hello,

I exported the game for the WebGL test. The game works fine in fullscreen mode (1920x1080), however 960x480 WebGL mode makes the dialogues in vertical line, too small, it's thinned out in the middle of the screen. How can I solve this? Thank you.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: WebGL Dialogue scale problem

Post by Tony Li »

Hi,

This isn't specific to the Dialogue System. Here are two ways to handle UI scaling:

1. Add a Canvas Scaler component. Set it to Scale With Screen Size, and set a reference resolution such as 1920x1080. In a 960x480 WebGL window, Unity will scale the UI to half size so everything looks proportionally the same as 1920x1080 screen.

2. Or set the UI elements' anchors so they'll move around relative to the edges of the screen.

More info: Designing UI for Multiple Resolutions
User avatar
DryreL
Posts: 29
Joined: Sat Dec 26, 2020 1:58 pm

Re: WebGL Dialogue scale problem

Post by DryreL »

Oh, I thought it was already have it... Ok, thanks.

Another more thing, I'm edited Focus template a bit and one thing left to done. By default, both speaker names are always written there (both names are visible). I just want the name of the one speaker who speak to be written/visible. How can I do that?
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: WebGL Dialogue scale problem

Post by Tony Li »

Hi,

You can configure the OnFocus() and OnUnfocus() methods to show and hide the names, or you can control them in your focus and unfocus animations.
Post Reply