Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

Tinting sprite color


mariogarranz
 Share

Recommended Posts

Is there any way to tint the color of a sprite?

The only way I've seen I can do this is either having different textures for the same sprite, or overlaying 2 sprites with transparency. First one limits the number of colors, second one sounds like CPU consuming to me.

Is there any other option? Thanks :)

Link to comment
Share on other sites

After some search on the forums I found this answer from past October:

 

http://www.html5gamedevs.com/topic/1897-i-want-to-highlight-my-sprites-could-you-point-me-in-the-right-direction/?hl=tint#entry12982

 

I haven't found any news about Pixi supporting shaders, so I guess its still not built in Phaser.

Link to comment
Share on other sites

  • 3 weeks later...

I'm very interested in this as well

 

I have an habit of making grey spritesheet and tinting them in the chosen color, in order to be able to have variety without increasing the textures ammount.

 

This seems to be the most basic feature to me ( as in Flixel, Unity ...etc... ) so I'm a little surprised not to find it in Phaser/Pixi (I'm not making any critic here, just wanting to understand )

 

Is this so much time-consuming?

Is it not just a shader multiplying each pixel color by another color?

 

Thanks for your time.

Link to comment
Share on other sites

  • 6 months later...

It's in 1.2 (because Pixi added support for it). Note that you create an extra canvas object for every single texture you tint, so use it sparingly. On WebGL it's all done in a shader, but not on canvas.

 

Is this still the case? The canvas profiler in chrome shows me only one canvas, even with tinted sprites in the game, or wouldn't this show up in the profiler?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...