Khawar
Khawar

Reputation: 5227

zoom a sprite in andengine (Android)

I want my sprite (sprite has dynamic body) to zoom-in or zoom-out smoothly, let's say when I click this sprite. i tried to use EntitiyModifier and ScaleModofier in it. Below is the code I used:

SequenceEntityModifier seq_zoom = new SequenceEntityModifier(
            new ScaleModifier(4f, 1f, 0.454545f));
........
mMySprite.registerEntityModifier(seq_zoom); // On Clicking the sprite

But nothing happens to the sprite. Can anyone guide me, on how to apply smooth zooming on a sprite?

Upvotes: 0

Views: 1206

Answers (1)

Jong
Jong

Reputation: 9115

First of all, what you are doing is enlarging the sprite, it does not zoom on it (Rest of the scene stays the same size and scaling).

You can use the SmoothCamera, you can see an example here. I think its better than scaling (even though it does the same..)

Upvotes: 1

Related Questions