How do I disable collisions for text objects?

Get help using Construct 2

Post » Fri Mar 06, 2015 7:10 am

I've implemented a custom check-button in my game. The check-button consists of a sprite and a text object.
If the mouse clicks on either the sprite or the text, the button's state is toggled.

Sometimes a check-button is set to invisible. And while invisible, I disable the sprite's collision, so that clicking on it will have no effect. But for some reason, I can't disable collisions on the text object from what I can tell.
B
17
S
2
Posts: 66
Reputation: 1,382

Post » Fri Mar 06, 2015 8:40 am

I believe collision is only for interaction between two objects.

Safest way to disable click would be to add boolean variable "clickable" into object, and in every mouse click condition also condition which will check if "clickable" variable is true.

And every action which should disable clicking could switch "clickable" variable to false, and every action whick should enable clicking should switch "clickable" to true.
B
12
S
6
G
2
Posts: 99
Reputation: 1,727

Post » Fri Mar 06, 2015 7:47 pm

Hmm, ok, I'll try something like that, thanks.

I still find it strange that an object can be clicked when it isn't visible.
B
17
S
2
Posts: 66
Reputation: 1,382

Post » Fri Mar 06, 2015 11:07 pm

if you dont want things to be able to be clicked when not visible add the contrition is visible to your touch event
B
42
S
17
G
2
Posts: 850
Reputation: 6,209


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 10 guests