Hello Guest

Author Topic: How to change Target Height in SpriteCollection's setting at Runtime  (Read 3469 times)

agp12

  • Newbie
  • *
  • Posts: 1
    • View Profile
So I want to differentiate the target height in runtime, because if the game runs on Iphone 4 or 4GS, then the target height will be different than the target height I want on Iphone 5.
How can I change that in runtime?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to change Target Height in SpriteCollection's setting at Runtime
« Reply #1 on: March 16, 2013, 05:55:12 pm »
You dont.
You simply change the orthographic size of your camera to compensate.
To make the camera pixel perfect again, use this:
      float pixelHeight = camera.pixelHeight;
      float newOrthoSize = pixelHeight / (float)initialCameraHeight * initialCameraOrthoSize;