Resizing dialogue boxes

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
lostmushroom
Posts: 194
Joined: Mon Jul 01, 2019 1:21 pm

Resizing dialogue boxes

Post by lostmushroom »

Hey, I'm stuck trying to resize dialogue boxes so that they don't go off screen if you write a lot of text.

I'm using Corgi with the Bubble UI dialogue panels. Currently, it only displays one line of text, so if you write a lot, you get one long line that goes off screen. Is there a way to make a line break after it gets to a certain size? Aiming for something a bit like the dialogue boxes in Night in the Woods.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resizing dialogue boxes

Post by Tony Li »

Hi,

You can add a KeepRectTransformOnscreen script to the panel to keep it onscreen. (Add it to the child Panel, not to world space canvas CorgiStandardDialogueControls.)

For line breaks, you can either add them manually or set a maximum width on the subtitle panel. If you set a maximum width, make sure the Text element's Horizontal Overflow is set to Wrap (the default value).

To see an example of setting a maximum width, see the Bubble Template Standard UI Subtitle Panel prefab. It has a maximum width of 1024 pixels.
lostmushroom
Posts: 194
Joined: Mon Jul 01, 2019 1:21 pm

Re: Resizing dialogue boxes

Post by lostmushroom »

I can see the Width and Height fields both set to 1024 in Rect Transform in Bubble Template Standard UI Subtitle Panel - is that what I should be looking for?
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resizing dialogue boxes

Post by Tony Li »

Yes, that's it. Here's an example scene with it set up on Dude1:

DS_CorgiLimitSizeKeepOnscreenExample_2019-07-22.unitypackage
lostmushroom
Posts: 194
Joined: Mon Jul 01, 2019 1:21 pm

Re: Resizing dialogue boxes

Post by lostmushroom »

Nice, got it working :) Thanks
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Resizing dialogue boxes

Post by Tony Li »

Great!
Post Reply