Jump to content
Search Community

benfrain

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by benfrain

  1. Hi Carl, thanks for the prompt response. I've now used Snap now to achieve this end but yes, having the capability to do this in GSAP would be great (even if it was a payable plugin) as I am only including Snap at present to carry out this specific task. Looking forward to seeing it in GSAP native at some point in the future.
  2. I'm wondering if it should be possible to tween between two sets of path values with the same number of points. For example, suppose I have an SVG with the following path data: <path id="n" d="M1.00000015,71.269657 L1.00000015,75.5026892 L0.999999988,98.6925107 L1.00000015,120.019657 C0.999999984,121.276249 0.999999984,123.013553 0.999999898,124.044071 L0.999999984,148.012996 L150.002473,148.012989 C150.553392,148.012989 151,147.561778 151,147.00891 L151,0.462184836 150.555247,0.0126430611 150.009303,0.0126430611 L2.79077147,0.0126430611 L0.999999988,0.0126430611 C0.999999988,1.31665305 0.999999984,22.0117224 0.999999984,22.0117224 C0.999999985,23.3740268 0.999999988,24.5196567 0.999999988,25.5836215 L0.999999988,49.3460918 C0.999999988,49.3460918 1.00000015,70.2861365 1.00000015,71.269657 Z"/> And with GSAP I do this: var changedShapeID = theSVG.querySelector('#n'); var changedShapePath = "M1.38388602,72.2082603 C0.973032172,73.2106889 0.958561277,74.8587265 1.35575085,75.8776525 L10.6365755,99.6930029 L1.32038928,121.509149 C0.907211953,122.510356 0.89074975,124.158726 1.28793932,125.179275 L10.568764,149.025648 L179.637832,149.013553 C180.189423,149.013514 180.636576,148.56227 180.636576,148.009402 L180.636576,2.01721499 C180.636576,1.46267711 180.179902,1.01313533 179.641046,1.01313533 L10.6365755,1.01313533 C10.5753064,0.379674194 1.38388602,22.8687273 1.38388602,22.8687273 C0.973032172,23.8711559 0.958561277,25.5191935 1.35575085,26.5381195 L10.6365755,50.3465841 L1.38388602,72.2082603 Z"; TweenMax.to(changedShapeID, 0.75, {attr: {'d': changedShapePath}}); I get the shape snapping to the new path shape, rather than tweening to it. As a GSAP beginner I'm unsure whether this is: 1. expected behaviour and I need to use another tool alongside GSAP (such as Snap)? 2. an error between keyboard and chair, in that I'm just doing something wrong? Can anyone point me in the right direction?
×
×
  • Create New...