2D Toolkit Forum

2D Toolkit => Support => Topic started by: Tongie on January 17, 2013, 02:23:26 pm

Title: how to get Sprite height and width?
Post 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?
Title: Re: how to get Sprite height and width?
Post by: unikronsoftware on January 17, 2013, 04:26:24 pm
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).
Title: Re: how to get Sprite height and width?
Post by: Tongie on January 18, 2013, 03:21:31 am
thanks got it to work...