Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quadratic, cubing, quartic eases #631

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MSGhero
Copy link
Member

@MSGhero MSGhero commented Sep 17, 2024

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

@ianharrigan
Copy link
Member

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

@MSGhero
Copy link
Member Author

MSGhero commented Sep 18, 2024

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

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