Sign in to follow this  
Ninjadoodle

Tint Question

Recommended Posts

Hi @enpu

Recently, you added some flags to the 'flash' function, so we could crop the edges -> this.sprite.flash(250, '#ffffff', null, 8, 8, 8, 8);

Any chance something like this could be added to the 'tint' function as well?

Thanks for any feedback :)

Share this post


Link to post
Share on other sites

@Ninjadoodle

I just added new tintCrop property to Sprite class. It is instance of Rectangle, so you could define all the 4 values.

sprite.tint = '#ff0000';
sprite.tintCrop.x = 20; // Crop tint 20px from left
sprite.tintCrop.y = 20; // Crop tint 20px from top
sprite.tintCrop.width = 20; // Crop tint 20px from right
sprite.tintCrop.height = 20; // Crop tint 20px from bottom

sprite.tintCrop.set(20, 20, 20, 20); // Shorthand

 

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.