How to Center the Buttons on the Response Menu Panel

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

How to Center the Buttons on the Response Menu Panel

Post 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!
Last edited by CodePrincess on Wed Oct 30, 2019 10:59 pm, edited 1 time in total.
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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 823 times
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

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

Post by CodePrincess »

We're looking to have the buttons be in the center of the panel. Thanks for answering so quickly!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

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

Post 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.
CodePrincess
Posts: 111
Joined: Thu Sep 27, 2018 11:06 pm

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

Post by CodePrincess »

… And Sis is happy! Thank you so much for your help!

May your night be good and all your bugs found handily!
Thank you so much for your help.

Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

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

Post by Tony Li »

Have to keep the family happy! :-)
Post Reply