2D Toolkit Forum
2D Toolkit => Support => Topic started by: Tongie on January 17, 2013, 02:23:26 pm
-
how do i get the the height and width of my jpeg or png file in unity?
-
You can get the physical world space sprite height and width by getting the renderer bounds. You can also get the sprites local bounds by calling sprite.GetBounds (http://unikronsoftware.com/2dtoolkit/doc/html/classtk2d_base_sprite.html#abc5d84fc4f1158dad2c8e180ebb21538) and sprite.GetUntrimmedBounds (http://unikronsoftware.com/2dtoolkit/doc/html/classtk2d_base_sprite.html#a738ea31c3a243e7249bdea2ac5c84eb9).
-
thanks got it to work...