Page 1 of 1
RPGB Dialogue UI
Posted: Wed Feb 17, 2021 9:44 pm
by Grayson
Is there a way to control the width that the dialogue expands to? The prefab has it at a nice size, but when it displays in-game the width is almost the size of the game window. Anyway to control this?
Thanks.
Re: RPGB Dialogue UI
Posted: Thu Feb 18, 2021 8:43 am
by Tony Li
Hi,
The dialogue UI prefabs that ship with the Dialogue System use Unity UI. If you're not too familiar with how Unity UI works, Unity's site has decent tutorials, but I think the
Introduction to Unity UI tutorial on raywenderlich.com is a more straightforward intro.
Two examples of ways you can control the size:
- Add a Canvas Scaler to the Canvas. Set UI Scale Mode to Scale With Screen Size. This will scale the UI proportionally to the actual screen resolution. So if you're playing on a screen that's twice the resolution as the Canvas Scaler's reference resolution, it will double the size of all UI elements to keep everything proportionally the same.
- Or change the dialogue panel(s)' Rect Transforms to use a different type of anchoring, such as bottom center instead of stretching to fit the screen width. This will make the UI span the same number of pixels regardless of resolution, resulting in a smaller UI in higher resolutions, with a wider margin of empty space on either side.