Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
how to get Sprite height and width?
« previous
next »
Print
Pages: [
1
]
Author
Topic: how to get Sprite height and width? (Read 8611 times)
Tongie
2D Toolkit
Newbie
Posts: 23
how to get Sprite height and width?
«
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?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
Re: how to get Sprite height and width?
«
Reply #1 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
).
Logged
Tongie
2D Toolkit
Newbie
Posts: 23
Re: how to get Sprite height and width?
«
Reply #2 on:
January 18, 2013, 03:21:31 am »
thanks got it to work...
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
how to get Sprite height and width?