7

In the Phaser 3 docs I can see that the biggest difference between Sprite and Image is that you cannot animate or add a physics body to an Image, but in Image properties you can see an animationManager. I'm a little confused about this. Can anyone clarify this?

1 Answer 1

15

Actually, according to the official docs Phaser.GameObjects.Image does not have a AnimationManager property.

Phaser.GameObjects.Sprite on the other hand does have an anims that can access animations, but doesn't include a direct property of type AnimationManager. Both can be confirmed by using the TypeScript defintions.

This is because AnimationManager is global, and handles all animations. In Phaser 2 all objects would handle their own animations. See for example Phaser 2 CE's Phaser.Image docs.

So just as the documentation says, Image is effectively a static, lighter-weight, Sprite.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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