Hi,
I am attempting to implement animations using MonoGame.Extended. I have used Astrid Animator to create a .aa file. My issue occurs when attempting to create a SpriteSheetAnimationGroup. All the files build correctly in Content.mgcb.
The error occurs on this line
var playerAnimations = Setup.ContentDevice.Load<SpriteSheetAnimationGroup>("Sprites/animation_player");
@gabbage Make sure the texture path within the animation is correct; the animation, when loaded, needs to load the texture.
It seemed to be caused by the file name. Does the texture path have to follow a name-atlas.json format?
Sorry, it’s the texture atlas, not the texture. When you call contentManager.Load<SpriteSheetAnimationGroup>("Sprites/animation_player");
it will call contentManager.Load<TextureAtlas>(textureAtlasAssetName);
The error you are experiencing is that it’s trying to load a TextureAtlas
but loaded a Texture2D
.
By the way, this API changed in the development branch so you could consider it deprecated. Ideally there will be documentation addressing the API change when the new version rolls out.