openfl / actuate

Actuate is a flexible, fast "tween" library for animations in Haxe
MIT License
158 stars 66 forks source link

Allow setting easing params #87

Closed chatziko closed 6 years ago

chatziko commented 6 years ago

An unfortunate side-effect of 37a09ae48 is that it made impossible to set easing params for the classes that support them (Elastic and Back). This is because:

Not sure what's the most elegant way of fixing this, but here's an attempt:

  1. I added easeInWith / easeInOutWith / easeOutWith functions for passing params, eg:

    Actuate.tween (MySprite, 1, { alpha: 1 }).ease (Elastic.easeOutWith(0.3, 0.5));
  2. I set the properties themselves to (default, null) to avoid surprises.