Sizing issues after scene change

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
andrew2110
Posts: 39
Joined: Wed Sep 03, 2014 2:44 am

Sizing issues after scene change

Post by andrew2110 »

www.blueomega.me/SizingIssues.mp4







The video shows a forced conversation with an NPC which triggers the tutorial battle for the user. The tutorial battle is intended to contain a number of dialogue texts to guide them through their first battle. However on getting into the battle, I can't quite figure out why the Dialogue System makes the text boxes so tiny. I think it's a case of me not understanding where the sizes of these boxes are set. I have set anchors on these boxes to set them to the size I would like but also get a feeling they're dynamically resized somewhere to fit the text in them?






User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Sizing issues after scene change

Post by Tony Li »

Hi,



The Dialogue System doesn't do any resizing. It only calls NGUITools.SetActive() to activate and deactivate NGUI widgets. You can reproduce this issue without the Dialogue System. In fact, I recommend making a simple test scene containing only "NGUIDialogueUI 1 (Clone)". Remove the NGUIDialogueUI component so it doesn't hide itself at start. Then you can set the widgets active and play around with them.



On the UserPanel, notice when you change an anchor's offset (the number after the "+"), it changes the dimensions in the Widget section. The dimensions start at 40x40, which is why the UserPanel is a tiny 40x40 box.



If you want to use a set size, just set it; there's no need to use an anchor. Since your UIRoot's Scaling Style is set to Constrained, it will automatically scale the box according to the screen resolution. So if you make it 640 pixel wide in the default 1280-width screen, it will be 320 pixels wide on a 640-width screen.



If you want the box to automatically scale to the size of the content, I believe you can set the Anchor target to the content.



If that doesn't help, please feel free to send me an example project. I'll be happy to take a look.


andrew2110
Posts: 39
Joined: Wed Sep 03, 2014 2:44 am

Sizing issues after scene change

Post by andrew2110 »

Thank you!







After you helped me understand how it works, I just removed the anchors  and it all seems to work fine now. Something funny happens that doesn't let me use anchors but thats not down to Dialogue System and doesn't seem worth investigating further now.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Sizing issues after scene change

Post by Tony Li »

I'm glad it's working now. I know I've said this before, but your game is looking good!
Post Reply