Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

Morph svg on canvas in animate cc

Recommended Posts



Ive just soaw new release of gsap, and update to morph svg to render mode to draw on canvas. This is wonderfull. Does that mean we can now morph shapes in animate cc as well ?


Best regards.

Share this post

Link to post
Share on other sites

Yes, just replace the canvas code in the draw function with the equivalent graphics code for easel.js. 



Although, I'm not sure if you can set an "evenodd" fill with easel.js.


TweenMax.to("#hippo", 2, {

function draw(rawPath, target) {  
  var l, segment, j, i;
  ctx.clearRect(0, 0, vw, vh);
  for (j = 0; j < rawPath.length; j++) {
    segment = rawPath[j];
    l = segment.length;
    ctx.moveTo(segment[0], segment[1]);
    for (i = 2; i < l; i+=6) {
      ctx.bezierCurveTo(segment[i], segment[i+1], segment[i+2], segment[i+3], segment[i+4], segment[i+5]);
    if (segment.closed) {


  • Like 2

Share this post

Link to post
Share on other sites

Thank You for the reply.


Will try to do that. Seeing You sugested the draw by function, im asuming this will not work by simpy drawning a shape from animate interface and pas that as a variable to draw function, corect ?

Share this post

Link to post
Share on other sites

Correct. GSAP cannot animate the shape for you.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.