Skip to content

Add a param generic to Animator to allow multiple tweens over the same component - #151

Closed
meepleek wants to merge 31 commits into
djeedai:mainfrom
meepleek:animator_marker
Closed

Add a param generic to Animator to allow multiple tweens over the same component#151
meepleek wants to merge 31 commits into
djeedai:mainfrom
meepleek:animator_marker

Conversation

@meepleek

Copy link
Copy Markdown
Contributor

I love using this crate, but not being tween parts of the same component at different times (I guess it might be possible to recreate a Tracks tweenable?) can be quite cumbersome (I'm looking at you, Transform). Enter marker components to have different types of animators based on the marker.

    commands.spawn((
        Sprite {
            color: RED.into(),
            custom_size: Some(Vec2::splat(size)),
            ..default()
        },
        Animator::new(translation_tween).with_marker::<TransformTranslation>(),
        Animator::new(scale_tween).with_marker::<TransformScale>(),
        Animator::new(rotation_tween).with_marker::<TransformRotation>(),
    ));

There's a bunch of stuff missing, hence the draft state. Lemme know if you think it would be of value.

Things to do to move this out of draft state

  • go-ahead from @djeedai
  • AssetAnimator
  • docs
  • tests
  • better example to show how this might be useful compared to a Tracks tweenable
  • dupe the animator systems to avoid introducing breaking changes?

meepleek and others added 30 commits April 6, 2022 17:31
@meepleek

meepleek commented Aug 1, 2025

Copy link
Copy Markdown
Contributor Author

Closing as stale

@meepleek meepleek closed this Aug 1, 2025
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.

2 participants