I'm trying to have a certain scene in my game where all of the game sprites have a gray overlay on them. I thought about just creating a gray version of each sprite, but then I realized that is not very DRY or easy. I need this overlay for both a singular sprite, like so:
sprite = game.add.sprite(x, y, "name_of_sprite");
And I need it for a group:
group = game.add.group();
How do you this in context of phaser
?
Either one of these solutions will do the trick:
Sprite tinting
yourSpriteName.tint = color;
Gray filter example
var gray = game.add.filter("Gray");
yourSpriteName.filters = [gray];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With