Author Topic: Get real size of UISprite  (Read 1537 times)


  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Get real size of UISprite
« on: November 20, 2014, 07:06:13 PM »
Hello there, i'm having some trouble instantiating a WebView (using prime31 asset).

Here's what i'm trying to do: To instantiate the webview, i'm asked for 2 ints that represent x and y, x obviously is 0, but y i need to change. I'm trying to get my top bar sprite height to instantiate the webview (the blue bar in the attached photo). I tried UISprite.height but it always return 106, witch is the image size, but i want the real pixel height of the image. I'm trying to get this number, because the image doesn't have the same "real" size in every device.



  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Get real size of UISprite
« Reply #1 on: November 20, 2014, 09:28:59 PM »
Multiply that value by the UIRoot's pixelSizeAdjustment.