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

Curves and Path #40

Open
kefniark opened this issue Mar 5, 2019 · 0 comments
Open

Curves and Path #40

kefniark opened this issue Mar 5, 2019 · 0 comments

Comments

@kefniark
Copy link
Owner

kefniark commented Mar 5, 2019

Description

  • With tweens, we have linear movement
  • With sequence, we have serial or parallel linear movements

It's fine but for some type of motion it can still look quite unnatural.
The idea would be to provide so specific tween (only with position: Vector2(x, y) or Vector3(x,y,z)):

  • Curve (simple bezier curve with 2 control point)
Fatina.bezier(
  {x:0, y:0}, // start
  {x:108, y:32}, // control point 1
  {x:176, y:32}, // control point 2
  {x:196, y:160}, // end position
  250 // duration
)
// any usual method (.setTimescale(), .yoyo(), onComplete(), .setEasing(), ...)
.start()
  • Path: go through a list of 2D point in a certain duration (unlike sequence where each tween has his duration)
Fatina.path(
  [{x:0, y:0}, {x:108, y:32}, {x:176, y:32}, {x:196, y:160}], // n point to go through
  250 // duration
)
// any usual method (.setTimescale(), .yoyo(), onComplete(), .setEasing(), ...)
.start()
  • Curve Path: A mix of both previous one, the equivalent of sequence for curves.

Concern

  • For bezier, yes there is a real need
  • For Path and Curve path, I still wonder if it's not possible to just use Sequence and provide a way to compute duration based on global speed and distance of each tween on the fly.

Screenshot

Bezier curve

Curve Path

@kefniark kefniark self-assigned this Mar 5, 2019
@kefniark kefniark mentioned this issue Mar 10, 2019
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant