How do I set position to sprite with visible animation frame

Get help using Construct 2

Post » Sun Apr 06, 2014 11:27 am

i have sprite called 'color' with 5 frames (colours),
i have other sprite called 'ok' with one frame
i put on layout 5x this 'color' same sprite But in each of them i changed the frame from 0 to 4.
Now when my global wariable called 'frame' is set to 0, sprite 'ok' should set position to sprite 'color' but on needed animation frame ?
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,426

Post » Sun Apr 06, 2014 1:16 pm

If I understand you correctly you want to pick your Color sprite with the right frame and move to it?
You can actually pick by animation frame..

I made you a little capx:
http://honigmilch.com/capx/framepicker.capx

The red box is your OK. It waits 1 second, and then it picks a Color instance by a random animation frame (you could do that with the frame you need, of course), and lerps itself onto the position of the picked Color.

You have to be aware though that having more than one instance with the same frame number will cause more than 1 get picked, and that might screw up your whole setup, so be extra careful with methods like that..
B
78
S
28
G
32
Posts: 481
Reputation: 19,788

Post » Sun Apr 06, 2014 1:50 pm

@Eisenhans i edit your example: https://dl.dropboxusercontent.com/u/44710358/frame.capx

now all works fine but when i click on other colors, sprite 'ok' should skip to this clicked color
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,426

Post » Mon Apr 07, 2014 3:00 pm

anyone?
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,426

Post » Mon Apr 07, 2014 4:25 pm

this ?
You do not have the required permissions to view the files attached to this post.
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Mon Apr 07, 2014 4:45 pm

@RamPackWobble YES :))
B
111
S
28
G
48
Posts: 1,882
Reputation: 36,426


Return to How do I....?

Who is online

Users browsing this forum: KefiRocK, Lordshiva1948 and 5 guests