Scale sprite?

For questions about using Classic.

Post » Fri Jan 16, 2009 6:36 am

Is there an easy way to scale a sprite, as in an animation?
Im wanting to simulate a ship landing so I need it to scale in a series down to x size, and then up when it leaves.
I've tried set sprite.height to sprite.height -10, set sprite.width to sprite.width -10 on the is moving condition, but the sprite turns does a 180, and then gets bigger... wtf?
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588

Post » Fri Jan 16, 2009 1:58 pm

Scaling a sprite shouldn't affect it's rotation, are you sure it's not rotating because of the movement behaviour it has?
B
2
S
1
G
5
Posts: 59
Reputation: 1,518

Post » Fri Jan 16, 2009 3:36 pm

newt i think i know what you mean. its problay getting so small that it inverts the sprite around then keeps growing (negative width). you have to limit its scaling to a small interval. setting the width to .width-10 will keep doing that every tick, thus making it smaller till it inverts and grows. try setting it to (get original width)-10
B
33
S
5
G
8
Posts: 1,210
Reputation: 7,046

Post » Fri Jan 16, 2009 4:34 pm

Yeah, negative widths and heights mirror and flip objects. You want to stop it at 0.
Scirra Founder
B
382
S
223
G
86
Posts: 23,998
Reputation: 189,773

Post » Fri Jan 16, 2009 6:08 pm

Oh ok, I see now, I guess that's one of those "features".
Image ImageImage
B
165
S
49
G
147
Posts: 8,048
Reputation: 96,588


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest