RPGB Dialogue UI

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Grayson
Posts: 20
Joined: Wed Jan 13, 2021 4:00 pm

RPGB Dialogue UI

Post 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.
User avatar
Tony Li
Posts: 22166
Joined: Thu Jul 18, 2013 1:27 pm

Re: RPGB Dialogue UI

Post 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.
Post Reply