making a button non-clickable

0 favourites
  • 8 posts
From the Asset Store
Make your own platformer for both the web and mobile easy with this Santas Platformer Template, FULLY DOCUMENTED
  • i have 3 buttons and at one point i want two of them to be inactive and non-clickable. is there a simple method for forcing a button to be unselectable? how about through using a variable? button variables are card1, card2 and card 3. cards 2 and 3 need to be non-clickable. i started with "compare instance value -- if cardValue is not equal to 1" but i can't seem to find an action to pair with this which would disable the button.

    anyone have any suggestions or a solution?

    thanks!

    rob

  • You set the 2 Buttons to Disabled

  • through code or direct selection? if code, is that an action or event? thanks yonda.

  • its an action

  • If you did want to go the variable route, create an instance variable on each button called clickable, set it to true or false depending on if the button should be clickable, and in your touch/click event have it check to see if clickable is true.

  • BluePhaze (or anyone):

    Here's a screen capture of my event sheet. I see that you can change an instance variable, even with "clickable" as 1 of 2 options. I went ahead and set this so that any card other than Cardvalue 1 would have a clickable value of "false" (these events are on the Card 1 instance, by the way). And it still doesn't work, all the cards still fire/are clickable.

    Can you tell what's wrong here? I've got to wrap this project today. Help!

    Thanks

    Rob

    BluePhaze (or anyone):

    Here's a screen capture of my event sheet. I see that you can change an instance variable, even with "clickable" as 1 of 2 options. I went ahead and set this so that any card other than Cardvalue 1 would have a clickable value of "false" (these events are on the Card 1 instance, by the way). And it still doesn't work, all the cards still fire/are clickable.

    Can you tell what's wrong here? I've got to wrap this project today. Help!

    Thanks

    Rob

    NOTE: I just uploaded a .capx example -- kaleidodesign.com/misc/nonclickable.zip

    <img src="http://www.kaleidodesign.com/misc/nonclickable.png" border="0" />

  • still need help or solved?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • yonda, still need help. i left a link to a .cpax file in my post above if you'd like to take a look:

    kaleidodesign.com/misc/nonclickable.zip

    thanks!

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