Instructions: Use your mouse or finger and drag and drop the anchor points to modify the curvature of the quadratic curve and the Bezier curve. Open in new window
HTML5 Canvas Modify Curves with Anchor Points Using KineticJS
Posted on January 7th, 2012
by Eric Rowell
Looks really cool, great job!
@Eric, how can I move shape to background layer?
Add excanvas for ie9-
@Oleg I posted your question with the answer on the KineticJS Forum here:
http://kineticjs.com/forum/viewtopic.php?f=5&t=8
@Inn IE9 fully supports the 2d context so excanvas shouldn’t be needed.
Can i apply it also on text? to curve?
Hi, follow up on monski’s post. is there a way to curve a text?? we really need that functionality. thanks
it’s absolutely possible, but certainly not trivial. I’ve avoided creating a tutorial that shows placing text along an arbitrary curve because the return on investment would be fairly low (very complex work, and not a lot of people need this).
Have you checked out my tutorial on drawing text along an arc? The approach would be very similar except that you’d have to calculate the tangent angle at each point (for a circle, the tangent is always 90 degrees from the center
http://www.html5canvastutorials.com/labs/html5-canvas-text-along-arc-path/
thanks :D
This looks like the wrong source code… Is it the “modify shape color on click code?” I’d love to see the code for this. Very nice library btw. =) Thanks in advance!
@Kevin whoops sorry about this! Made a mistake when updating this lab. Fixed now :)
Hi,
Can a layer have points like a polygon? So I could add an event on the layer like mouseout but for a specific area only. Because Stage contains the whole area and I need to bind it on a specific area.
Hallo Eric, is their a possibility to have a type of curve with 3 anchor points?
@Marc I’m not quite sure that makes sense – layers contain shapes, and shapes are the visual components of your canvas app. You can however, add event listeners to layers, but these listeners are applied to all of it’s children.
If you want mouse functionality for a specific area, you might try creating an invisible polygon (just don’t set the fill property)
Cheers!
@HPH sure, you would just need to combine three quadratic curves together
How connect them constrain?
Hypercurve
Please have a look to
http://processingjs.nihongoresources.com/bezierinfo/