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 Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

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
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

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
359
S
214
G
72
Posts: 22,946
Reputation: 178,528

Post » Fri Jan 16, 2009 6:08 pm

Oh ok, I see now, I guess that's one of those "features".
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests