zarstar Posted September 10, 2014 Share Posted September 10, 2014 Very simple question today: is it possible to tint a SpriteBatch? Edit: I know that it isn't possible, I was asking for other ways to do that if there is anyone For example I read that it is possible to tint a Texture... is it true? and how? Quote Link to comment Share on other sites More sharing options...
Sebi Posted September 10, 2014 Share Posted September 10, 2014 The tinting process works by creating a new texture with the tint color applied.If all sprites in your spritebatch share the same texture, same tint, it should be possible to tint them. Haven't tested that yet tho. As for the canvas renderer, it is always possible to just tint the sprites, because that renderer doesn't care if the same texture is used or not.You could very well try to enhance the spritebatch shader to support tinting, but that might take away all reasons to even prefer SpriteBatch over DisplayObjectContainer. Quote Link to comment Share on other sites More sharing options...
zarstar Posted September 10, 2014 Author Share Posted September 10, 2014 To tint a texture is exactly what I would need, but I don't know how can I do it. Also, is it possible ot have a SpriteBatch interactive??? Quote Link to comment Share on other sites More sharing options...
hubert Posted September 10, 2014 Share Posted September 10, 2014 Sprite batch was not meant for tinting. The speed of spriteBatch comes from reduced functionalities. http://www.html5gamedevs.com/topic/8861-spritebatch-vs-displayobjectcontainer/?p=52540 http://www.sevenative.com Quote Link to comment Share on other sites More sharing options...
zarstar Posted September 12, 2014 Author Share Posted September 12, 2014 I know that, what I'd like to know if in someway (like changing the code manually) it could be "technically" possible to use only the tinting feature, or if it renders Sprites in a way that it isn't usable at all. Quote Link to comment Share on other sites More sharing options...
xerver Posted September 12, 2014 Share Posted September 12, 2014 Anything is possible, it is just software. It would be easier for you to just use a DisplayObjectContainer though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.