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
167
S
50
G
160
Posts: 8,168
Reputation: 103,432

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
41
S
8
G
9
Posts: 1,219
Reputation: 8,064

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
386
S
229
G
87
Posts: 24,207
Reputation: 191,662

Post » Fri Jan 16, 2009 6:08 pm

Oh ok, I see now, I guess that's one of those "features".
Image ImageImage
B
167
S
50
G
160
Posts: 8,168
Reputation: 103,432


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests