Skip to content
Snippets Groups Projects
  1. Nov 09, 2022
    • Jerome Humbert's avatar
      Fix incorrect change detection triggering (#71) · a3fecb10
      Jerome Humbert authored
      Ensure change detection on components and assets is only triggered when
      an animator effectively modifies said component or asset, and not
      invariably just by the simple fact of the animator ticking each frame.
      
      This change modifies the signature of the `component_animator_system()`
      and `asset_animator_system()` public functions to directly consume a
      `ResMut<Events<TweenCompleted>>` instead of an
      `EventWriter<TweenCompleted>`, to work around some internal limitations.
      
      It also publicly exposes a new `Targetable` trait used to work around
      the impossibility to retrieve a `Mut<T>` from a `Mut<Assets<T>>`.
      Instead, the trait provides an "target dereferencing" method
      `target_mut()` which dereferences the target component or asset, and
      triggers its change detection. The trait is implemented for all
      components via the `ComponentTarget` object, and for all assets via the
      `AssetTarget` object. The 3 types described here are publicly exposed to
      workaround some Bevy limitations, and because the trait appears in the
      public `Tweenable<T>` API. However users are discouraged from taking
      strong dependencies on those, as they will be removed once Bevy provides
      a way to achieve this conditionaly dereferencing without this
      workaround.
      
      Fixes #33
  2. Oct 02, 2022
    • Jerome Humbert's avatar
      Add `assert_approx_eq!()` testing macro (#66) · dd6ac741
      Jerome Humbert authored
      Clarify testing code and potential assertions message with the use of a
      new `assert_approx_eq!()` macro for `f32` equality check with a
      tolerance. The macro leverages `abs_diff_eq()` but produces a better
      assertion message in case of failure. It also allows skipping the
      tolerance parameter to use the default of `1e-5`, which is the
      "standard" tolerance to use for progress and other small-ish values that
      are expected to be equal but might be slightly off due to rounding
      errors.
      
      This change ignores the complications of testing for floating-point
      equality in a generic way, which is too complex, and instead restrict
      the usage to values like progress (range [0:1]) and other small position
      values around the origin.
  3. Oct 01, 2022
    • Jerome Humbert's avatar
      Add more tests (#65) · eeec3713
      Jerome Humbert authored
      Add some tests to fill gaps for:
      - `UiPositionLens`
      - `Animator::set_tweenable()` and `AssetAnimator::set_tweenable()`
      - `Sequence::from_single()`
      - `Delay`'s `then()`, `times_completed()`, and `set_progress()`
    • Jerome Humbert's avatar
      Fix animator speed feature (#63) · 4c2f49da
      Jerome Humbert authored
      Fix the animator speed applying, which got broken as part of the
      refactor of #44.
      
      Add a `speed()` getter to both `Animator<T>` and `AssetAnimator<T>`.
      
      Add some simple test for speed, but this is not enough to make sure the
      feature doesn't regress, so logged #62 to follow-up with a proper
      regression test.
      
      Fixes #61
  4. Aug 12, 2022
  5. Aug 04, 2022
  6. Aug 03, 2022
    • Alex Saveau's avatar
      Support running an animation N times (#19) · 6a871576
      Alex Saveau authored
      Remove `TweeningType` and split its functionalities between a new `RepeatCount`
      controlling the number of repeats of an animation on one hand, and
      `RepeatStrategy` controlling the way an animation restarts after a loop ended
      on the other hand. This allows more granular control on the type of playback.
      
      Remove the `tweening_type` parameter from `Tween<T>::new()` and replace it with
      builder methods `with_repeat_count()` and `with_repeat_strategy()`.
      
      Remove `is_looping()` from all tweenables, which was not implemented for most
      of them anyway.
  7. Jun 14, 2022
  8. Jun 01, 2022
  9. May 31, 2022
  10. May 17, 2022
  11. May 14, 2022
  12. Apr 24, 2022
  13. Apr 23, 2022
  14. Mar 19, 2022
    • Jerome Humbert's avatar
      Tighter dependencies with features (#9) · 6619f067
      Jerome Humbert authored
      Enable minimal dependencies with new features `bevu_sprite` and
      `bevy_ui`, removing the `bevy/render` mandatory dependency. Those new
      features are enabled by default, and enable the built-in lenses for the
      related Bevy crates. The core `bevy_tweening` crate itself does not take
      any optional Bevy dependency anymore, allowing for a slim build with
      only the core Bevy functionalities.
  15. Mar 05, 2022
  16. Feb 24, 2022
  17. Feb 16, 2022
    • Jerome Humbert's avatar
      Add event `user_data` and improve docs · 8dcd3d27
      Jerome Humbert authored
      - Add `TweenCompleted::user_data` to help identify the tween which
        raised the event.
      - Improved several docs.
      - Update CHANGELOG.
      - Update README with mention of events and callbacks.
      8dcd3d27
    • Jerome Humbert's avatar
      Add `TweenCompleted` event · e31e76dc
      Jerome Humbert authored
      Add a mechanism to `Tween<T>` to raise a Bevy event once the tween
      completed. The event raising can be enabled with `set_completed_event()`
      and `with_completed_event()`. The `TweenCompleted` event contains the
      `Entity` on which the `Animator<T>` or `AssetAnimator<T>` owning the
      tween are attached.
      
      Update the `sequence` example to show how to use that new event
      mechanism.
      e31e76dc
  18. Feb 13, 2022
    • Jerome Humbert's avatar
      Clarify and increase control on playback state · 38e99394
      Jerome Humbert authored
      Add some new methods and refactor some existing ones to clarify the
      playback state of a tweenable, and give increased control to the
      `Animator` or `AssetAnimator` to rewind a tweenable, set its progress to
      an arbitrary value, or query its current state.
      38e99394
  19. Feb 12, 2022
  20. Jan 29, 2022
  21. Jan 28, 2022
  22. Jan 27, 2022
Loading