How to disable sprite

Get help using Construct 2

Post » Fri May 19, 2017 1:31 am

i have two sprite button in the same position when i click the button(top) it will click too the second button(back) how to fix that?
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 1:44 am

You can add an instance variable to each button that uses boolean value - then toggle on/off for the button to be enabled or disabled.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Fri May 19, 2017 1:54 am

You have an example?
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 2:33 am

SoldjahBoy wrote:You can add an instance variable to each button that uses boolean value - then toggle on/off for the button to be enabled or disabled.

~Sol


its not working for me :( i set already in boolean=false and still clickable
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 2:51 am

You need to add the boolean value to the condition of the click...

Mouse clicked on button
Boolean value = true
---- do stuff

Mouse clicked on button
Boolean value = false
---- do nothing

You will need to upload your capx or make a simple version of what you're trying to do, so I can edit it to work. I'm not exactly sure about the method or placement of your buttons, so making an example probably won't help if I don't make it the same way you have it set up.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
83
S
34
G
40
Posts: 3,032
Reputation: 30,474

Post » Fri May 19, 2017 5:54 am

SoldjahBoy wrote:You need to add the boolean value to the condition of the click...

Mouse clicked on button
Boolean value = true
---- do stuff

Mouse clicked on button
Boolean value = false
---- do nothing

You will need to upload your capx or make a simple version of what you're trying to do, so I can edit it to work. I'm not exactly sure about the method or placement of your buttons, so making an example probably won't help if I don't make it the same way you have it set up.

~Sol


i cant post links
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 9:59 am

Just add an instance variable id to your button's, set the first button to id 1, second to id 2, when you make your event, add button compare instance variable id 1 for the first button, 2 for the second, and it will work like a charm.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Fri May 19, 2017 11:02 am

sorry i dont get it please make a sample capx
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 11:02 am

imhotep22 wrote:Just add an instance variable id to your button's, set the first button to id 1, second to id 2, when you make your event, add button compare instance variable id 1 for the first button, 2 for the second, and it will work like a charm.


sorry i dont get it please make a sample capx
B
6
Posts: 20
Reputation: 302

Post » Fri May 19, 2017 11:33 am

Sure, here it is.

dropbox.com/s/5dluuathupbx0m2/button_click.capx?dl=0

edit: I changed the link, it should work now.
Last edited by imhotep22 on Fri May 19, 2017 12:12 pm, edited 1 time in total.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Next

Return to How do I....?

Who is online

Users browsing this forum: blackhornet, tarek2 and 28 guests