Page 1 of 1

How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 3:17 pm
by CodePrincess
So, I just debuted the demo I've been working on to my sister and she doesn't like how the buttons in the Response menu spawn either at the top or the bottom and wants them centered. Does anybody know how to do that, or if there's a template or setting I could use to achieve this effect?

Thank you so much for your help!

Re: How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 3:57 pm
by Tony Li
Hi,

Do you want the entire response menu panel centered in the center of the screen, or do you want the buttons centered inside the response menu panel?

It's all Unity UI, so you'll need to adjust the Unity UI positions.

For example, if you're using the Basic Standard Dialogue UI prefab change the Response Menu Panel's Rect Transform to these values:

responseMenuCentered.png
responseMenuCentered.png (18.68 KiB) Viewed 830 times

Re: How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 3:59 pm
by CodePrincess
We're looking to have the buttons be in the center of the panel. Thanks for answering so quickly!

Re: How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 4:54 pm
by Tony Li
Hi,

Try this:

On the Response Menu Panel's Scroll Rect, remove the Scroll Rect, Mask, and Image components.

Add a Vertical Layout Group. Tick Child Controls Size > Width. Set Child Alignment to Middle Center.

This assumes you're using the Basic Standard Dialogue UI or something similar. If you're using a dialogue UI with a vastly different Unity UI layout, you may need to change different Unity UI settings.

Re: How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 10:57 pm
by CodePrincess
… And Sis is happy! Thank you so much for your help!

May your night be good and all your bugs found handily!

Re: How to Center the Buttons on the Response Menu Panel

Posted: Wed Oct 30, 2019 11:16 pm
by Tony Li
Have to keep the family happy! :-)