Skip to main content

Crate bevy_tween_helpers

Crate bevy_tween_helpers 

Source
Expand description

§Using The Crate

  • First, you should add BevyTweenHelpersPlugin, to which you can add a logging function of your choice.
  • Then, register each of the following plugins for each interpolator type you wish to apply them to:
    • AnimationParentDestroyerGenericPlugin
      • Automatically despawns animation parents if it has no children left, for example a parent with no tweens
      • Automaitcally despawns animation parents tagged with AnimationParentToDestroyIfOnlyHasEventsLeft if they only have event-emitting tweens left
      • If EventAnimationParentTaggerPlugin is added as well, automatically tags animation parents with AnimationParentToDestroyIfOnlyHasEventsLeft if they have event-emitting tweens
    • TweenTargetRemover
      • Automatically removes entities from tween targets when their AnimationTarget component is removed
      • Listens to target removal tween requests and triggers
      • Combining it with AnimationParentDestroyerGenericPlugin results in automatic tween and parent clearing
    • TweenPriorityHandler
      • Handles TweenPriorityToOthersOfType, when tweens or parents have this component, fight against other tweens of that type. The ones with the highest priority will survive.
      • If you’re not sure what the previous bullet means, read TweenPriorityToOthersOfType’s description
  • I also added my tween combinators, feel free to open PRs requesting to add your own!

§Example

An example for registering the plugins into your app would be:

    app.add_plugins((
            DefaultTweenPlugins, //from bevy_tween
            BevyTweenHelpersPlugin::default(),
            TweenTargetRemover::<MyGloriousInterpolator>::default(),
            TweenPriorityHandler::<MyGloriousInterpolator>::default(),
            AnimationParentDestroyerGenericPlugin::<MyGloriousInterpolator>::default(),
            EventAnimationParentTaggerPlugin,
            TweenSkipTaggerPlugin
        ))
        .add_tween_systems(component_tween_system::<MyGloriousInterpolator>()); //from bevy_tween

Modules§

animation_parent_destoryer
bevy_tween_helpers_plugin
custom_combinators
event_animation_parent_tagger
extra_transform_tween_makers
macros
prelude
target_extractor
tween_priority
tween_request
tween_skip_tagger
tween_target_remover
utilities

Macros§

plugin_for_implementors_of_trait
read_single_field_variant
trait_union