Page 1 of 1

Resizing dialogue boxes

Posted: Mon Jul 22, 2019 2:29 pm
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.

Re: Resizing dialogue boxes

Posted: Mon Jul 22, 2019 3:23 pm
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.

Re: Resizing dialogue boxes

Posted: Mon Jul 22, 2019 5:29 pm
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?

Re: Resizing dialogue boxes

Posted: Mon Jul 22, 2019 6:36 pm
by Tony Li
Yes, that's it. Here's an example scene with it set up on Dude1:

DS_CorgiLimitSizeKeepOnscreenExample_2019-07-22.unitypackage

Re: Resizing dialogue boxes

Posted: Tue Jul 23, 2019 4:50 pm
by lostmushroom
Nice, got it working :) Thanks

Re: Resizing dialogue boxes

Posted: Tue Jul 23, 2019 5:21 pm
by Tony Li
Great!