Sign in to follow this  
Ninjadoodle

Can't change sprite.tintAlpha

Recommended Posts

Hi @enpu

When I setup a sprite and give it a 'tint', I can set the 'tintAlpha' with no issues.

I however can't seem to be able to change the 'tintAlpha' on a mouse click.

Is this a bug / limitation or am I missing a step somewhere?

Thanks heaps!

Share this post


Link to post
Share on other sites

@Ninjadoodle

This was a limitation in the engine, but should be now changed.

Note that every time you change tint or tintAlpha value, the engine needs to render new tinted texture for the sprite. So if you are doing this a lot, it can get a bit heavy. On that case, i would look for a different approach, like using two separate sprites in top of each other, the top one as a tinted one and then just change it's alpha value.

Share this post


Link to post
Share on other sites

Hi @enpu

Awesome, thanks heaps for this. In this case it's a really simple effect and I'm only using it on 4 tiles very sparingly - I really don't think my case will affect performance.

Just for your info, setting the tintAlpha to 0 does not work. I can set it to a very low number (0.000001) but not 0 :)

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.