Jump to content
Search Community

How to write a plugin that can work with KineticPlugin

terro test
Moderator Tag

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

+1

 

Forgive me for hijacking your post but I also wanted to add that it would be nice if there was a bit more documentation/examples on the use of multiple plugins.

 

Specifically, can the ThrowProps plugin work with the Kinetic plugin? What would the usage look like?  ....ThrowProps: { Kinetic: {....} }   or Kinetic: { ThrowProps: {...} }?  I assume it would be the former, but unless I made a mistake it didn't seem to work when I tried.

 

thanks 

Link to comment
Share on other sites

Hi Guys,

 

The reason why there isn't a lot of info on writing plugins for plugins is because it isn't supported. You can't pass values into 1 plugin that have been run through another plugin in the same tween. For instance, properties controlled by KineticPlugin can not also be run through ThrowProps at the same time in the same tween.

 

This is the reason why we baked the functionality of DirectionalRotationPlugin, RoundPropsPlugin, ColorPropsPlugin and BezierPlugin into the KineticPlugin. 

 

In the case of using ThrowProps with KineticJS, you can create a ThrowProps tween that uses an onUpdate to call draw() on the target object's layer and you should be fine. 

  • 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...