I want to apply scaleModifier on a Sprite when it is touched. I apply the scaleModifier like below:
mMySprite.registerEntityModifier(new ScaleModifier(2f, 1f, 0.5f));
There is also a Dynamic body attached to this. I read that the body will not be changed but atleast the sprite should be scaled. But nothing happens. Can any one tell me how can I do this and whats missing?
I have this code:
And it works fine. Make sure that if you use
IOnSceneTouchListeneryou also register it:Or, if you decided to override
onAreaTouchmethod, make sure you register your animated sprite as a touch area: