How do I make all other buttons off when i click one of them

0 favourites
  • 3 posts
From the Asset Store
Click! Click! 136 click sounds for your video games or media projects
  • Hello!

    I have one really nooby question. I guess it's very simple but i really don't know how to implement it. I have 7 buttons on my interface, added to a family called "DressButtons". I want when i click on one of them to turn off all other buttons. So when user click on Button 1 and then click on Button 2 i want to Button 1 be turned off. Right now i have to click same button again in order to turn it off.

    This is my current event sheet:

    I have tried picking all instances with this boolean enabled, but it's turning off previous and current button that i have pressed.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • On touched makes a picklist containing that 1 button that is touched.

    When that (and only that) button is touched before ... pressed is toggled off for that and only that button.

    Else that (and only that) button ... pressed is toggled on for that and only that button.

    Since the picklist contains 1 button, you dont reach the other buttons.

    Just add the function plugin to the project.

    A function starts picking from scratch.

    So ...

    Condition ..

    On touched Dressbuttons

    Actions ..

    Call function "unpress"

    disable effect

    set width to 40

    set boolean pressed to true (dont toggle)

    Condition ..

    On function "unpress"

    Actions

    Pick all Dressbuttons

    enable effect

    set widt to 200

    set boolean pressed to false

  • Thanks! This worked!

    I just found one error in this code, but i fixed it!

    On touched Dressbuttons action need to enable effect and Function need to disable it

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)