Sub-buttons

Hi all,

in the MENU of my experience I need, when I click on a button (which is actually a circle image), this moves smoothely to the LEFT and 2 Sub-buttons appear.
When I click again on the same button the 2 sub-buttons must Hide and this one moves at the initial positiion.

To do this I have created:

  • counter (each time I click +1)
  • global variable binded to the counter with the Script INPUT%2==0 do this else do that…

on the click I control if the result of the %2 is 0 or 1 so I move from one direction or to the other one.

Is there any better and simpler way to do this?
Thanks
Paolo

Hi Paolo,

To achieve what you need, I’ll set up something very simple, like:

  • an Image Toggle Button for your Menu Button
  • a Trigger/Action: WHEN Image Toggle Button is checked THEN "show Sub-buttons"
  • a Trigger/Action: WHEN Image Toggle Button is unchecked THEN "hide Sub-buttons"

That’s a method we use in some of our Design Accelerators.
I recommend you to check in your Composer to see how it’s build. Add the Animated Menu - Pack 2 design accelerator and look at the “Sub-category menu” component.

It behaves like this:

Another good inspiration, adding Excel power to the Toggle Buttons method, would be this dedicated article: Create navigation menus generated from Excel (with some sample to download included).

Kind regards,

Alex.

Thank you @Alex, this surely helps a lot!
need to redo a bit the MENU 'cause now the buttons are all images.
Checked and Unchecked do the work I done but saving me a LOT of uselss variables :slight_smile:

Do you think also swapping images with buttons the reactivity of the click will be better?
We are required to speed up our experience asap and the loading of the scenes is one of our worst points… (4-5 seconds to open each).

thanks again
Paolo

For sure, using simple Toggle Buttons with just the right amount of design (through simple colors and font) will be faster to load than Image Toggle Buttons with 2 states images for each.