ControlledTexture implementation to facilitate Sprite use and allow complete currentFrame control #1307
DeathPhoenix22
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm using Sprites in my game, a lot of Sprites with different states and specs.
I've ended up creating a ControlledTexture texture type that allow the use of a Sprite sheet texture to basically do whatever you want with it. The simplest of example is a SpriteSheet representing a rotating building (Isometric). You'll have 1 image per supported angles. (let's say 4 -> North, West, South, East). You provide an animation channel along with an animation driver. The animation Driver will allow you to define which one is the currentFrame and the AnimationChannel will store the proper intel related to each frames.
This makes custom SpriteSheet manipulations extra easy.
@AlmasB Do you want me to PR a generic solution in FXGL directly ?
Beta Was this translation helpful? Give feedback.
All reactions