Jump to content
GreenSock

MatiasGravano

tint does´t work in animate

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

Hi,

I am trying to change the color of an object on the stage, but "tint" does´t work at all.

I have already loaded ColorFilter.js in the Script Global.

This is my code:

 

this.clip.addEventListener("click", colorear.bind(this));

function colorear(evt){
    TweenMax.to(this.clip, 0, {easel:{tint:"#000000"}});
}
 

Does anybody know how can I make it works?

Thank you!

 

 

Link to comment
Share on other sites

please zip a small demo with all your files so we can look at it. thanks.

Link to comment
Share on other sites

Thanks for the zip. Very helpful. 

 

Seems you had 2 issues:

 

1: in order to have a filter applied successfully in EaselJS land you need to call cache() on the object. However, Animate CC gives you an option in the properties panel which comes in handy:

 

8MwezzuXTSCfu6dCgj6L-w.png

 

2: You weren't loading the GSAP EaselPlugin. I don't really know what those ColorMatrixFilter.js file is that you were referencing. This is the CDN url that you can drop into the Global includes

 

https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.0/plugins/EaselPlugin.min.js

 

Here is a fixed demo for you: demo-fixed.zip

 

 

  • Like 3
Link to comment
Share on other sites

Thank you very much, Carl! It works perfectly.

I really appreciate your help!

Link to comment
Share on other sites

You're welcome! 

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