making a button non-clickable

Get help using Construct 2

Post » Wed Nov 06, 2013 8:38 am

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
B
4
Posts: 10
Reputation: 220

Post » Wed Nov 06, 2013 9:09 am

You set the 2 Buttons to Disabled
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Wed Nov 06, 2013 9:16 am

through code or direct selection? if code, is that an action or event? thanks yonda.
B
4
Posts: 10
Reputation: 220

Post » Wed Nov 06, 2013 9:53 am

its an action
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Wed Nov 06, 2013 5:22 pm

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.BluePhaze2013-11-06 17:23:01
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Nov 06, 2013 7:01 pm

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 -- http://www.kaleidodesign.com/misc/nonclickable.zip

robsimmons2013-11-06 19:53:16
B
4
Posts: 10
Reputation: 220

Post » Wed Nov 06, 2013 8:09 pm

still need help or solved?
B
19
S
6
G
3
Posts: 197
Reputation: 4,154

Post » Wed Nov 06, 2013 8:23 pm

yonda, still need help. i left a link to a .cpax file in my post above if you'd like to take a look:

http://www.kaleidodesign.com/misc/nonclickable.zip

thanks!robsimmons2013-11-06 20:23:49
B
4
Posts: 10
Reputation: 220


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, R0J0hound and 39 guests

cron