2D Toolkit Forum
2D Toolkit => Support => Topic started by: David Kalina on July 18, 2013, 06:57:10 pm
-
OK, so we've decided that it'll be easiest for our (now) 2D game to have sprites instantiated at pixel size.
This way, a 256x128 texture added to a sprite collection will be instantiated at world unit size 256x128.
I've checked "use tk2dcamera" in order to accomplish this... even though I am not using a tk2dcamera to render my game world. Are there any side effects of that checkbox that I need to be aware of?
Also, is there a single call I can make into a tk2dsprite to get its size in world coordinates (accounting for hierarchy scale, tk2dsprite scale, and source sprite size)? The aforementioned sprite will have a transform.scale=1,1,1 and a tk2dsprite.scale=1,1,1... so how do I know it's actually 256x128?
Thanks!
David
-
Hi David,
There is no problem to using the "Use tk2dCamera" tickbox. It is just shorthand for 1 pixel per meter. In the next version of 2D Toolkit, you will be able to specify the size in pixels per meter too.
About your second question - tk2dBaseSprite.GetUntrimmedBounds() returns the size of the sprite in Unity units, but that is excluding the hierarchy scale. You shouldn't really be using hierarchy scale in most cases anyway, as it is likely to break batching.