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\$

2 Answers 2

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\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.