Jump to content
Search Community

Custom Bounce with an attr: {cy: <delta>}

MichaelGaddis test
Moderator Tag

Recommended Posts

Simple question, (I hope) I want to have a bounce on an object I'm moving inside a (rather complex) SVG. The drop looks like this:

 

Does the CustomBounce ease work with an SVG attr delta on a cy value? For instance: (The stones moves where it's suppose to but it doesn't bounce.)

Ifv it should work on an attr: cy move then I have a bug and I'll search for that... Thanks in advance

 

import { CustomEase } from "gsap/CustomEase";
import { CustomBounce } from "gsap/CustomBounce";
 
gsap.registerPlugin(CustomEase);
gsap.registerPlugin(CustomBounce);
 
CustomEase.create("gameDiskBounce2", "M0,0 C0,0 0.103,0.819 0.228,1 0.273,1.066 0.231,0.928 0.312,0.928 0.354,0.928 0.35,0.91 0.388,0.976 0.403,1.003 0.418,1 0.468,1 0.524,1 0.509,1 0.556,1 0.596,1 1,1 1,1");
 
bunch of code...
 
gsap.to(this.stoneDOMRef, {attr: {cy: RowSVGCyArray[row - 1]}, ease: "gameDiskBounce2", onComplete: ()=> { this.updateStoneLocation(callbackWhenAnimationCompleted, column); }});
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...