How do I

Get help using Construct 2

Post » Sat Dec 20, 2014 2:56 pm

how would you make a layer with HUD visbible or invisible hitting the same key ?
can somebody post a small capx ? I am sure it should be with else!...but still having problems :/

thanks 4 all the helping hands
B
39
S
17
G
2
Posts: 464
Reputation: 5,049

Post » Sat Dec 20, 2014 3:07 pm

The easiest way I've found to toggle anything on/off is by creating a variable and then use the following string to set it: Set variable to 1-variablename. What it does is if the variable is equal to 0 then 1-0=1 so it will switch it to 1. If the variable is 1 then 1-1=0 which switches it to 0.

So in your example.
On key pressed > Set variable HUD to 1-HUD

If variable HUD = 0 > Make objects invisible
else > Make Objects visible
B
62
S
20
G
56
Posts: 1,077
Reputation: 36,021

Post » Sat Dec 20, 2014 3:59 pm

thanks a lot :)
B
39
S
17
G
2
Posts: 464
Reputation: 5,049

Post » Sat Dec 20, 2014 4:01 pm

This is how it's done
You do not have the required permissions to view the files attached to this post.
B
262
S
49
G
15
Posts: 2,010
Reputation: 42,235

Post » Sat Dec 20, 2014 5:34 pm

thank U :) !!!!!!!!!!!!!!!!!!!!!!!!!!
B
39
S
17
G
2
Posts: 464
Reputation: 5,049



Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests