haxeui-core icon indicating copy to clipboard operation
haxeui-core copied to clipboard

Add quadratic, cubing, quartic eases

Open MSGhero opened this issue 1 year ago • 2 comments

Add a few common easing functions, with a few questions regarding scope:

  1. A quick search seems like CSS doesn't define a whole bunch of eases. Does that matter wrt what gets defined in haxeui?
  2. Does "reverse easing function" need to be updated for every ease if it's a CSS thing?
  3. Tunable complex eases like bounce maybe don't need to be implemented here? As in, externally defining a Float->Float easing function may be more flexible
  4. If we define a bunch here, how many? Sine, quintic, exponential, back, circular, elastic...

Will update formatting, unless you have something quick for that

MSGhero avatar Sep 17 '24 04:09 MSGhero

A quick search seems like CSS doesn't define a whole bunch of eases. Does that matter wrt what gets defined in haxeui?

I wouldnt say so - the animation system is going to be overhauled at some point - so now is a nice time to get as many things in so they dont get "lost in the shuffle" - css animations can always be enhanced "later"

Does "reverse easing function" need to be updated for every ease if it's a CSS thing?

Usually, i would say "yes", but here i feel like it doesnt matter so much - i doubt many (any?) people are using css animations (they are clunky - even in css3) so i think it can wait for a refactor (that wont stop the clunkiness of them ofc)

Tunable complex eases like bounce maybe don't need to be implemented here? As in, externally defining a Float->Float easing function may be more flexible

At some point (probably sooner rather than later), ill see about making all this moddable by the module.xml - that way if someone does want to an a new function they wont need to go through and modify core code like you have had to

I do like the idea about "tunable easing functions" though... how would the function signature for, for example, a tunage bounce look - it maybe worth trying to get that type of thing working now.

If we define a bunch here, how many? Sine, quintic, exponential, back, circular, elastic...

as many as you want - the ones you have listed seem perfectly sensible to me

Will update formatting, unless you have something quick for that

I dont

ianharrigan avatar Sep 17 '24 06:09 ianharrigan

Ok let me just add most of these then https://easings.net/

Here is a bounce definition, with the coefficients affecting how many bounces etc image

MSGhero avatar Sep 18 '24 03:09 MSGhero