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
163
S
48
G
99
Posts: 7,436
Reputation: 71,494

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,198
Reputation: 5,622

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
362
S
216
G
75
Posts: 23,067
Reputation: 180,321

Post » Fri Jan 16, 2009 6:08 pm

Oh ok, I see now, I guess that's one of those "features".
Image Image
B
163
S
48
G
99
Posts: 7,436
Reputation: 71,494


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 12 guests