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

Allow Sprite to specifiy staring animation #418

Open
straker opened this issue Dec 31, 2024 · 0 comments
Open

Allow Sprite to specifiy staring animation #418

straker opened this issue Dec 31, 2024 · 0 comments
Labels
feature New feature or enhancement

Comments

@straker
Copy link
Owner

straker commented Dec 31, 2024

Currently the starting animation of a Sprite is the first animation listed. If you want the Sprite to start with a different animation you have to call playAnimation right after creating the Sprite.

const sheet= SpriteSheet({
  animations: {
    idle: ...,
    walk: ...
  }
})

const sprite = Sprite({
  animations: sheet.animations
});
sprite.playAnimation('walk');

It would be nice if there was an option in the Sprite constructor to specify the starting animation.

@straker straker added the feature New feature or enhancement label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant