Jump to content
Search Community

shaderbytes

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by shaderbytes

  1. Docs say : An Array of objects defining other properties (doesn't need to be "x" and "y"). This will basically smooth out the velocity changes as it hits each value Great , except it seems to now be enforcing expecting the target to be a dom element , error : Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element' I use greensock on javascript objects in other libraries , eg in babylonjs. If I want to animate any property on any object within that library it normally works. I know this plugin has some features that would require the target to be a dom element ( its trying to call "parseTransform" on the object ) but now the issue is your entire path animation system is tied to this restriction? Surely your animation code should be target agnostic and just animate the values and set those values on the object , expecting the developer to have set a target that would use the values in some manner. ( or they just will do nothing , at least no errors due to calling functions that dont exist )
  2. wow how could I be so daft Thanks a million! you really helped me out there , the mistake had camo'ed itself from me
  3. So I created a plane following a quad bezier , i thought switching point 1 and point 3 would invert the bezier direction but it does not. <script> $("#remote-vacationicon").on("click",MovePlaneLeft); $("#remote-houseicon").on("click",MovePlaneRight); function MovePlaneLeft() { MovePlane("left"); } function MovePlaneRight() { MovePlane("right"); } function MovePlane(direction) { console.log("MovePlane " + direction); var house = $("#remote-houseicon"); var vacation = $("#remote-vacationicon"); var hp = house.position(); var vp = vacation.position(); var midpointx = Math.abs(hp.left - vp.left); var midpointy = Math.abs(hp.top - vp.left); if ("right") { TweenMax.to(document.getElementById("remote-plane"), 5, { bezier: { type: "quadratic", curviness: 1, values: [{ x: vp.left, y: vp.top, scaleX: 0, scaleY: 0 }, { x: midpointx, y: midpointy, scaleX: 1, scaleY: 1 }, { x: hp.left, y: hp.top, scaleX: 0, scaleY: 0 }], autoRotate: true }, ease: Power1.easeInOut }); } if ("left") { TweenMax.to(document.getElementById("remote-plane"), 5, { bezier: { type: "quadratic", curviness: 1, values: [{ x: hp.left, y: hp.top, scaleX: 0, scaleY: 0 }, { x: midpointx, y: midpointy, scaleX: 1, scaleY: 1 }, { x: vp.left, y: vp.top, scaleX: 0, scaleY: 0 }], autoRotate: true }, ease: Power1.easeInOut }); } } </script> this is a dynamic sprite of a plane and uses the house icon and vacation icon to build the path , the one control point is just the average of these points. Anyway no matter if i call this function for right or left ,the plane always moves from right to left- like in the "left" defined tween. the "right" tween just switches the insertion of the anchors points.. im a nood to GSAP so sorry for any misunderstandings.
×
×
  • Create New...