Load animation images at run time

Get help using Construct 2

Post » Sat Oct 12, 2013 3:37 pm

How do I load individual sprite animation images for a selected sprite at run time. I know of the "Load image from URL" but how do I get the image into a particular frame of the animation?

Can I have different instances of the sprite with different animation sequences?Digitizer2013-10-12 15:38:56
B
5
S
2
Posts: 12
Reputation: 499

Post » Sat Oct 12, 2013 3:49 pm

intances of the same sprite always have the same animations.

If you set the animation to have more frames and set the speed to 0 you can change between animation-frames by using set frame.

Load image from url loads into the frame the sprite is currently displaying, so if you want different images loaded make sure you load them on different frames.

I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Oct 12, 2013 4:05 pm

Yeah, I found what I was messing up. It seems that you have to have the number of frames pre-defined (before run time), i.e. you cannot load an image into a frame that does not yet exist (via the animation editor).
B
5
S
2
Posts: 12
Reputation: 499

Post » Sat Oct 12, 2013 7:59 pm

@Digitizer if you are worried about downloads, you can just make 1x1 pixel frames. It will resize them dynamically iirc.

@LittleStain, Thanks for the tip! I have only done single frames, I never realized we could do animations too!
B
29
S
8
G
4
Posts: 767
Reputation: 5,985


Return to How do I....?

Who is online

Users browsing this forum: tarek2 and 28 guests