...update a button or text field

Get help using Construct 2

Post » Sun Dec 30, 2012 6:03 am

Hi there,

So I'm working on a test game to see how i would make a game i'm currently building with gamesalad in Construct2.. so far so good, but i quickly discovered some questions about how to update the state of something..

i'm making a button toggle when touched. i spawn a new graphic when its touched over the old one (might not be the best way).. but the problem i run into is when i lift my finger or mouse.. i can't figure out how to tell it to do something when released.. in this case display the "off" button graphic.

none of the actions from what i can tell seem to offer the touch command a "when released" condition to meet, which i'm used to having in GameSalad. I know its possible, its just eluding me.

i'm also using a global variable that i want to update from 0 to 1 and back to 0 based on if an object is currently being touched or not.. i think that will be remedied as well once i know how to properly track an "upon release" type of condition.

Thanks!
Caleb
B
51
S
7
G
1
Posts: 869
Reputation: 5,943

Post » Sun Dec 30, 2012 9:02 am

That new graphic you spawn, make the event for it trigger once (or however many times you need, or infinitely) on "is not touching" (i.e. use "is touching", invert it).

When Button touched -> Spawn Button2
Once when Button2 not touched -> Do crazy stuff
B
26
S
5
G
1
Posts: 62
Reputation: 2,335

Post » Sun Dec 30, 2012 10:40 am

Something like this?

Button Example

I made this example a while back but it should give you an idea. Wink2012-12-30 10:52:22
B
50
S
11
G
8
Posts: 479
Reputation: 9,911

Post » Sun Dec 30, 2012 3:49 pm

INVERT! that is what i didn't realize i could do in C2.. and @wink awesome example. :) thank you so much. the mouse over extra touch and timer usage is also very helpful!

now back to it.. http://part12studios.com/promo/ctf/HTML5/

Thanks!
Caleb

B
51
S
7
G
1
Posts: 869
Reputation: 5,943


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, NRABrazil, totoe and 26 guests