Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: The SpriteSheetAnimation is now an asset #4

Merged
merged 7 commits into from
Jul 12, 2021

Conversation

jcornaz
Copy link
Owner

@jcornaz jcornaz commented Jul 11, 2021

This is a breaking change!

The SpriteSheetAnimation is now an asset. Which means, one has to insert a Handle<SpriteSheetAnimation> created via Assets::<SpriteSheetAnimation>::add instead of using the SpriteSheetAnimation directly as a component. See the examples for more details.

  • Now the animation can be created once and reused many times. Even with some different sprite-sheets, as long as they share the same frame indices, durations and animation mode (once or repeat).
  • It is now easier to check what is the current animation as the Handle is a unique identifier of the animation.
  • Current animation is now easier (and cheaper) to change, as we no longer need to create a new animation each time. (look at the change_animation for an examble)

It also opens the door for storing animations ar ron (or equivalent) and load them using the asset server, bringing hot-reload support out-of-the-box. (But that's not part of this PR)

Resolve #2

Remaining tasks

  • Log an error when SpriteSheetAnimation is used as a component.

@jcornaz jcornaz self-assigned this Jul 11, 2021
@jcornaz jcornaz changed the title feat!: Make the sprite-sheet-animation an asset feat!: Make the SpriteSheetAnimation an asset Jul 11, 2021
@jcornaz jcornaz changed the title feat!: Make the SpriteSheetAnimation an asset feat!: The SpriteSheetAnimation is now an asset Jul 11, 2021
@jcornaz jcornaz enabled auto-merge (squash) July 12, 2021 19:33
@jcornaz jcornaz merged commit 2a895a5 into main Jul 12, 2021
@jcornaz jcornaz deleted the feat/animation-asset branch July 12, 2021 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the frame list an asset for efficient sharing/reuse of animations
1 participant