2D Toolkit Forum
2D Toolkit => Support => Topic started by: drkucho on January 20, 2015, 09:18:24 pm
-
how can i do this ? i need the coordinates / bounds data from each sprite inside atlas, i am doing my tests using the tk2dCollectionData properties but no luck, i have tried regionX, regionY, regionW and regionH but these seems to be the coordinates for the sprite sheet :-(
-
http://2dtoolkit.com/forum/index.php/topic,4146.msg19547.html#msg19547
Its not directly exposed because a sprite could be non-rectangular, etc. We don't store a rect but you can guess from teh geometry as described above.
-
sorry but i don't understand? ... tk2dSpriteGeomGen.SetClippedSpriteGeom ...? what is / where is that? can't find a single result searching for that
-
Look for SetClippedSpriteGeom, its in the tk2dSpriteGeomGen class.
-
sorry can't find it :(
http://www.unikronsoftware.com/2dtoolkit/docs/latest/html/annotated.html
where is it?
-
aaah you mean inside the coooode!! , alright i found something but not sure im gonna understand it , so there are no variables/proerties i can read to know where the sprite is it?
-
Nope, the only thing that gets stored is the sprite geometry, and that can be non-rectangular and span multiple areas of the atlas (eg. sprite dicing). Its meaningless to have a texture rect in the general context of tk2d.
-
i see, and makes sense, ill use regular unity sprites for this specific thing, thanks for clarification