Page 1 of 1

Response Menu Panel - features

Posted: Wed Oct 28, 2020 4:19 am
by Adventure4Life
Hi,

Does the Response Menu Panel has the following features by any chance?

1. limit the maximum number Response buttons shown on screen?
for example I have 7 buttons which can be shown according to certain conditions
and I want to show only the first 5

2. can I use up and down arrows to scroll Response buttons instead of using scroll bar?

3. can I format response button with an icon like circle or 'x' to represnt the start of each button?

4. I have dialogue manager instance in my scene, its canvas has Canvas Scaler component
set to 'Scale with Screen Size" with resolution of 1920x1080.
but it doesn't keep the same proportion in other resolutions.
(in lower resolutions - part of the panel being cut off the screen, in higher resolutions it's very small)

thanks in advance

Re: Response Menu Panel - features

Posted: Wed Oct 28, 2020 8:34 am
by Tony Li
Hi

(I hope your game is going well. Congratulations on releasing it!)
Adventure4Life wrote: Wed Oct 28, 2020 4:19 am1. limit the maximum number Response buttons shown on screen?
for example I have 7 buttons which can be shown according to certain conditions
and I want to show only the first 5
You can make 5 buttons in your UI at design time and assign them to the response menu panel's Buttons list. Then unassign the Button Template. The menu will then only show the first 5.
Adventure4Life wrote: Wed Oct 28, 2020 4:19 am2. can I use up and down arrows to scroll Response buttons instead of using scroll bar?
The Dialogue System Extras page has a Menu Framework package. Inside the package is a script named ScrollToMe. You can extract ScrollToMe from the package and add it to your response buttons. When the focus is on a response button, the ScrollToMe script will make sure the scroll rect adjusts so the button is visible. Also tick the Dialogue Manager's Input Device Manager > Always Auto Focus to keep navigation focus on the menu even if the player clicks away with the mouse.
Adventure4Life wrote: Wed Oct 28, 2020 4:19 am3. can I format response button with an icon like circle or 'x' to represnt the start of each button?
Yes. Your response button probably has a child Text object (or TextMeshProUGUI). Adjust this object's Rect Transform to make space on the left. Then add another child to the button with an Image component, and assign your icon.
Adventure4Life wrote: Wed Oct 28, 2020 4:19 am4. I have dialogue manager instance in my scene, its canvas has Canvas Scaler component
set to 'Scale with Screen Size" with resolution of 1920x1080.
but it doesn't keep the same proportion in other resolutions.
(in lower resolutions - part of the panel being cut off the screen, in higher resolutions it's very small)
The Dialogue System doesn't do anything special with Canvas Scaler. Try setting Screen Match Mode to 'Match With Or Height', and change the Match slider all the way to 'Height'.

Re: Response Menu Panel - features

Posted: Thu Oct 29, 2020 10:48 pm
by Adventure4Life
Thank you so much Tony!! :D

Number 1 and 3 works perfect!

About number 2, I think I didn't explained myself well:

" can I use up and down arrows to scroll Response buttons instead of using scroll bar? "
I meant to arrows icons not keyboard keys like in the old school games,
these icons shown when more options available, clicking on them
navigate between options. they can be disabled\invisblie according to the number of
options available.
For example, if I have 5 pre-designed buttons and 6 options available
then when conversation start - arrow down will be enable and arrow up disable
then if you click on down arrow - up arrow will be become enabled, down arrow disabled
and options on screen will update accordingly.

About number 4, I tried to play with "Match" property during play mode
with different aspect ratio and it still cut-off in ratio such: 5:4, 4:3
even though the anchors of the response panel rect transform are "bottom-stretch"
but I think you're right, it's probably unity related and not the plugin.
PS I forced the aspect ratio of the game to 16:9 in AC is that might cause the probelm?

Re: Response Menu Panel - features

Posted: Fri Oct 30, 2020 9:35 am
by Tony Li
Adventure4Life wrote: Thu Oct 29, 2020 10:48 pm" can I use up and down arrows to scroll Response buttons instead of using scroll bar? "
I meant to arrows icons not keyboard keys like in the old school games,
these icons shown when more options available, clicking on them
navigate between options. they can be disabled\invisible according to the number of
options available.
You will have to write the code to do that. It's not built into Unity or the Dialogue System.

A Unity UI ScrollRect has a verticalNormalizedPosition property that indicates what proportion it would need to scroll down to reach the bottom. Normally, if this property is 1, then it's at the top of the scroll rect. If the property is 0, it's at the bottom.

When the property is at 1, disable the scroll up button. When the property is at 0, disable the scroll down button.

If there are 4 responses, then each button click will need to adjust verticalNormalizedPosition by 1/4 = 0.25. When the player clicks the down arrow button, subtract 0.25 from the verticalNormalizedPosition.

If you don't want to write the script to do this, maybe there is an asset on the Asset Store to do it. (I haven't checked.)
Adventure4Life wrote: Thu Oct 29, 2020 10:48 pmAbout number 4, I tried to play with "Match" property during play mode
with different aspect ratio and it still cut-off in ratio such: 5:4, 4:3
even though the anchors of the response panel rect transform are "bottom-stretch"
but I think you're right, it's probably unity related and not the plugin.
PS I forced the aspect ratio of the game to 16:9 in AC is that might cause the problem?
In general, these kinds of UI scaling issues are related to Unity and not the Dialogue System. However, in this case, it's probably related to AC's aspect ratio system. The Dialogue System's Adventure Creator integration has a script named "FitToAspectRatio" that fits a Unity UI canvas into AC's aspect ratio. Try adding it to the Dialogue Manager's Canvas.