Class: jgsap

physics.jgsap

This class acts as a proxy for `gsap` to animate basic properties of `matter.js` bodies and composites.
Source:
Example
physics.jgsap.to(this.box, 2.0, {scale:0.5, x:this.jrender.screenXToPhysMtrs(this.art.ball_3.x),y:this.jrender.screenYToPhysMtrs(this.art.ball_3.y), rotation:180.0, ease:Back.easeInOut, yoyo:true, repeat:-1});

Methods

from(target, dur, tw)

Replacement for `gsap.from` for targeting `Matter.js` bodies, with the same arguments.
Parameters:
Name Type Description
target Matter.Body | Matter.Composite The body or composite to animate.
dur number Duration, in seconds.
tw Object From gsap tween properties.
Source:

fromTo(target, dur, twFrom, twTo)

Replacement for `gsap.fromTo` for targeting `Matter.js` bodies, with the same arguments.
Parameters:
Name Type Description
target Matter.Body | Matter.Composite The body or composite to animate.
dur number Duration, in seconds.
twFrom Object From gsap tween properties.
twTo Object To gsap tween properties.
Source:

killAll()

Removes all pending and current animations and delayed calls.
Source:

killTweensOf(target)

Removes all pending and current animations and delayed calls for the given physics body or composite.
Parameters:
Name Type Description
target Matter.Body | Matter.Composite The body or composite to target.
Source:

to(target, dur, tw)

Replacement for `gsap.to` for targeting `Matter.js` bodies, with the same arguments.
Parameters:
Name Type Description
target Matter.Body | Matter.Composite The body or composite to animate.
dur number Duration, in seconds.
tw Object To gsap tween properties.
Source: