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
169
S
50
G
174
Posts: 8,331
Reputation: 110,806

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
48
S
10
G
9
Posts: 1,224
Reputation: 8,449

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
398
S
236
G
88
Posts: 24,441
Reputation: 194,681

Post » Fri Jan 16, 2009 6:08 pm

Oh ok, I see now, I guess that's one of those "features".
Image ImageImage
B
169
S
50
G
174
Posts: 8,331
Reputation: 110,806


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: grodrigues and 6 guests