How do I toggle visibility by touch

Just started using Construct 2? Post your questions here

Post » Wed Dec 03, 2014 8:57 am

I have a sprite that I want to toggle visibility by touch.
If it is invisible and you touch it, is should become visible.
If it is visible and you touch it, it should become invisible.

I have:

On tap gesture on sprite AND sprite is NOT visible, set sprite visibility to visible

This works.

But if I add another event:

On tap gesture on sprite AND sprite is visible, set sprite visibility to invisible

Then nothing works at all..

?
B
29
S
14
G
9
Posts: 80
Reputation: 6,013

Post » Wed Dec 03, 2014 9:08 am

Try: System: Else - set sprite visibility to invisible. Under your firs event. good luck!
B
20
S
4
G
4
Posts: 132
Reputation: 4,150

Post » Wed Dec 03, 2014 11:40 am

you mean like this
You do not have the required permissions to view the files attached to this post.
B
269
S
52
G
16
Posts: 2,045
Reputation: 44,140

Post » Wed Dec 03, 2014 5:05 pm

Monumental:

When I add the System:Else statement, it goes red and says "Not Valid Here"

LordShiva:

Your example is close, but I need the sprite to click-on, click-off.... Not temporarily click off then reappear..
You do not have the required permissions to view the files attached to this post.
B
29
S
14
G
9
Posts: 80
Reputation: 6,013

Post » Thu Dec 04, 2014 4:14 am

Figured it out..!
You do not have the required permissions to view the files attached to this post.
B
29
S
14
G
9
Posts: 80
Reputation: 6,013



Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests