Page 1 of 1

WRPG UI Template Question

Posted: Mon Mar 07, 2022 5:45 pm
by mokiedokes
Hi Tony,

Using the WRPG UI Template, I was wanting to move the player Response Button to the bottom of the screen. I've repositioned other elements by dragging them around or adjusting the pos coordinates in the inspector tab's rect transform, but for the Response Button, the rect transform values are greyed out. I also cannot drag the button. I wasn't sure how to unlock it to reposition it.

When clicking on the Response Button, in the Rect Transform it says "Some values driven by VerticalLayoutGroup." But I wasn't sure how to manipulate the button independent of that group or how to access that group.

Thank you in advance.

Re: WRPG UI Template Question

Posted: Mon Mar 07, 2022 8:28 pm
by Tony Li
Hi,

The WRPG Template Standard Dialogue UI prefab accumulates text in a scroll rect. Assuming you still want it to accumulate text, here are two ways you could handle it:

1. You could move the Response Menu Panel outside of the scroll rect:
wrpgMod1.png
wrpgMod1.png (21.78 KiB) Viewed 508 times

2. Or you could configure the Divider GameObject to expand vertically so the menu button(s) appear at the bottom. To do that:
  • Inspect the Response Menu Panel. Untick the Vertical Layout Group's Child Force Expand > Height checkbox.
  • Inspect Divider. Tick the Layout Element's Flexible Height checkbox.
  • Inspect Scroll Content. Add a Layout Element. Tick Min Height, and set it to 256.
wrpgMod2.png
wrpgMod2.png (16.77 KiB) Viewed 508 times

Neither approach is particularly specific to the Dialogue System. It's standard Unity UI layout, and fortunately there are lots of good tutorials on Unity UI. I recommend the raywenderlich.com Unity UI tutorial as a good starting point.

Re: WRPG UI Template Question

Posted: Tue Mar 08, 2022 6:55 pm
by mokiedokes
Thanks so much!

Re: WRPG UI Template Question

Posted: Tue Mar 08, 2022 7:03 pm
by Tony Li
Glad to help! If you get stuck or have questions, let me know.