Load Animation From File = Strange position change

For questions about using Classic.

Post » Tue Nov 06, 2012 4:06 am

I'm using Loop index to loop in a set of animations. When I hold down a key (right arrow) to activate an animation, the sprite moves to another position that's completely different from its idle position.

Is there any way to keep all of the animations in the same X and Y position when using Loop Index and Load Animation From File?

Here is the loading event and expression:

-> Hero: Load frame from apppath + "animate\" + str(global('Hero'))+"\"+ str(LoopIndex("animation"))+"\"+ str(LoopIndex("frame")) +".png"

Here is the .cap:

https://rapidshare.com/files/4090090539/Load%20Frame%20Test.zip
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Tue Nov 06, 2012 3:54 pm

Hmm, sounds like the image points aren't set in each frame in the CC editor. I'll try to check this out for you this week.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Tue Nov 06, 2012 5:10 pm

Hey JayJay,

After you mentioned the image points, I went back and realized I'd made two mistakes:

1. My 5 loading images for "animation 1" were a different size than the one for the idle animation (animation '0').

2. None of the image points were set.

I was under the wrong impression that Loading in images in Construct would operate the same as doing it the default way. Not so.

I'm all set now :-)

Thanks, JayJay!
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

Post » Tue Nov 06, 2012 7:24 pm

Heh no problem @MrMiller Glad to hear it worked out!Jayjay2012-11-06 19:25:05
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests