How do I define clickable frames

Get help using Construct 2

Post » Thu Sep 07, 2017 7:36 am

Message: yolkgames can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Help! How can I define clickable frames for an animation? see the video https://www.youtube.com/watch?v=WqIc_GvUbPQ see 0:27 sec... U can undersatnd what i say ......
B
9
S
3
Posts: 39
Reputation: 703

Post » Thu Sep 07, 2017 7:56 am

Not sure what am I supposed to see in your video at 0:27

If you want only certain frames be clickable, you can add this condition to your "On Click" or "On object clicked" event:
YourSprite -> Compare Frame
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,081
Reputation: 38,725

Post » Thu Sep 07, 2017 8:02 am

Thanks for your reply
How to control animation frame with mouse event
B
9
S
3
Posts: 39
Reputation: 703

Post » Thu Sep 07, 2017 9:56 am

You want to change animation frame when mouse is clicked? It's easy.

1. Add Mouse object to your layout if you haven't done it yet.

2. Create event:
Mouse -> On Click (or On Object Clicked)

3. Create action for this event:
YourSprite -> Set Animation Frame

Also, make sure that the animation is stopped (speed is set to 0).
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :)
B
17
S
9
G
71
Posts: 1,081
Reputation: 38,725

Post » Fri Sep 08, 2017 11:12 am

Hey @yolkgames!

It seems you have a sprite with multiple frames and want to advance to the next frame everytime you cklick that object, am I right?

Check the .capx below. Click to advance to the next color and right-click to go back to the previous one.

https://www.dropbox.com/s/v3afdy5mxxqyn ... .capx?dl=0

Hope it helps. Cheers!
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 45 guests