Jump to content
GreenSock

Praney Behl

Bezier curve for UI ?

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

First of all I would like to thank you for creating GSAP for JS its simply Amazing!

 

I was checking out : http://www.greensock.com/customease/ and thought it would be amazing to be able to do something like that in JS/HTML5, so I thought I'll ask.

 

Mate it may sound a little off-topic but is there a way to maybe draw such a bezier curve in HTML5/Javascript? I want to ask a a animate an object along the bezier path. Is it possible to maybe do something like this, where user can edit the bezier curve?

 

I hope I make sense, please pardon me if I don't as I am pretty new to JS/jQuery.

 

Looking forward to hearing about it.

 

Thanks in advance.

Praney

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

Here are 2 examples of rendering dots along a Bezier path

 

http://codepen.io/GreenSock/pen/ABkdL (DOM)

http://codepen.io/GreenSock/pen/CHwDx (Canvas)

 

For the best results you would probably want to feed the same Bezier data you are using for your tween into a canvas API like KineticJS:in: http://www.html5canvastutorials.com/labs/html5-canvas-modify-curves-with-anchor-points-using-kineticjs/

Link to comment
Share on other sites

Thanks Carl for taking the time to answer my question.

 

I am very new to the GSAP libraries but intermediate with JavaScript & jQuery, just trying to climb through the learning curve here. I know it would surely pay off.

 

I have a couple of more questions but I think creating new threads will be better as others can also refer to the Q&As

 

Cheers!

 

Praney

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×