Jump to content
Search Community

DrawSVG not animating - SVG issue or brain issue?

SammyC123 test
Moderator Tag

Go to solution Solved by GreenSock,

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

I haven't played with DrawSVG in a while and I'm trying to animate a simple path of some scribbles.  I thought it was as simple as a 

TweenMax.fromTo(obj, 3, {drawSVG: "0% 0%"}, {drawSVG: "100% 100%"});

 but no matter what I try, I can't get it to work.  I feel like I'm missing something super basic.  Is my SVG problematic or am I doing something wrong?

 

Thank you in advance!  I love this community and this product so much.

See the Pen by (@) on CodePen

Link to comment
Share on other sites

  • Solution

There are a couple of issues:

  1. The percentages refer to the starting and ending points of where the stroke is drawn, so "100% 100%" would literally have no length at all. I think you meant "0% 100%" :)
  2. DrawSVGPlugin is for animating the **stroke** of an SVG path/element, but it looks like you've got just a filled path. That won't work. If I understand your goal correctly, you'd need to animate a mask. Like maybe draw a stroked path over the top of your letters/signature and use DrawSVG to animate the stroke and use that as a mask (and of course make sure the stroke-width is thick enough). Not trivial, but probably doable. I think we've had a few other threads about this type of effect here in the forums like https://greensock.com/forums/topic/15868-animate-a-handwritten-signature/

Happy tweening!

  • Like 2
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.
×
×
  • Create New...