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

Support action: animation for slide and widget player #24

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

avanwinkle
Copy link
Contributor

This PR adds support for action: animation on slide and widget players to trigger animations on an MPFSlide or MPFWidget's attached animation_player node.

The syntax looks like this:

slide_player:
  item_highlighted:
    attract:
      action: animation
      animation: item_highlight_anim

In this example, the item_highlighted event would trigger the attract.tscn slide's AnimationPlayer node to play its "item_highlight_anim" animation.

This change is inspired by @albano353's carousel animation proposal in #23, taking that idea and extracting it to be broadly applicable. All MPFSlide and MPFWidget nodes already support an attached AnimationPlayer(for enter/exit/active animations) so the change to support the action: animation functionality is pretty simple.

Tested on a local game project using the above code snippet.

Note: this change requires a corresponding config_spec.yaml change, which has been merged to the MPF 0.80.x branch. Please pull the latest MPF to test.

in we go!

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.

1 participant