while looking for documentation, I'm really confused, since in https://docs.flame-engine.org/1.0.0/components.html?highlight=bodycomponent#spritebodycomponent SpriteBodyComponent is still using, but in
flame_forge2d: 0.12.3
flame: 1.4.0
I can't find this SpriteBodyComponent.
Because Im following a tutorial and the code looks like this:
class Ball extends SpriteBodyComponent {
...
}
But since I can not find SpriteBodyComponent, my code is like this:
class Ball extends BodyComponent{
...
}
And then tutorial is using Vector2 size from SpriteBodyComponent, and I have no idea what I can do.. since in official documentation SpriteBodyComponent still exists, but what I find from flame flame package is SpriteComponent but what I want to find should be from flame_forge2d something like SpriteBodyComponent, and if I use such code:
class Ball extends SpriteBodyComponent{
...
}
I got error Mixin can only be applied to class. and I can not find it in flame-forge2d package either.
thanks in advance for your help!
You are looking at the documentation for Flame
1.0.0, the latest version currently is1.4.0as you have found out, you can change version of the docs in the upper right corner.These are the latest
flame_forge2ddocs: https://docs.flame-engine.org/1.4.0/flame_forge2d/forge2d.htmlBut to answer your question, yes,
SpriteBodyComponenthas been deprecated. Now instead you add aSpriteComponentas a child to aBodyComponent, for example like this: