0
\$\begingroup\$

I want to scale an image before screen resume in AndEngine so I have applied the following code to my sprite:

ScaleModifier scaleDrag1 = new ScaleModifier(1, 1, 0.7f);

drag1.registerEntityModifier(scaleDrag1);

But my issue is that the scaled image is shown when the screen resumes because of the 1 duration. It makes my sprite scale after the screen resume so the scaling is visible to the user, I tried setting the duration to 0 but then that sprite is not shown.

Can anyone tell me what should I do to scale image before resume in AndEngine.

\$\endgroup\$
0
\$\begingroup\$

Casting is required in that case , i resolved with code below :

ScaleModifier scaleDrag1 = new ScaleModifier((float) 0.01, 1, 0.7f);
\$\endgroup\$
-1
\$\begingroup\$

You can scale the sprite by using drag1.setScale(0.7f).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.