2D Toolkit Forum

2D Toolkit => Support => Topic started by: edb on March 26, 2015, 05:23:17 am

Title: tk2dStaticSpriteBatcher - change a tk2dBatchedSprite
Post by: edb on March 26, 2015, 05:23:17 am
I'm optimizing some stuff and giving the tk2dStaticSpriteBatcher a try.
I've got some dynamically created sprites that never need to move, rotate or scale, so I'm gonna
put those in a tk2dStaticSpriteBatcher, but they do need to occasionally change color.

Can you change the color of a tk2dBatchedSprite?  Or change the material of a tk2dBatchedSprite?
If so, how do ya do it?

Thanks!
Title: Re: tk2dStaticSpriteBatcher - change a tk2dBatchedSprite
Post by: unikronsoftware on March 26, 2015, 06:09:25 pm
You can't change the color of a batched sprite - it will require rebuilding the entire batch which isn't efficient. You can grab the material on the batched sprite and modify it, but that will modify all of the sprites in one go.
Title: Re: tk2dStaticSpriteBatcher - change a tk2dBatchedSprite
Post by: edb on March 26, 2015, 07:05:26 pm
Ok - thanks!