Hello
Guest
Home
Help
Search
Login
Register
2D Toolkit Forum
»
2D Toolkit
»
Support
»
How to change Target Height in SpriteCollection's setting at Runtime
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to change Target Height in SpriteCollection's setting at Runtime (Read 4427 times)
agp12
Newbie
Posts: 1
How to change Target Height in SpriteCollection's setting at Runtime
«
on:
March 16, 2013, 06:28:04 am »
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?
Logged
unikronsoftware
Administrator
Hero Member
Posts: 9709
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;
Logged
Print
Pages: [
1
]
« previous
next »
2D Toolkit Forum
»
2D Toolkit
»
Support
»
How to change Target Height in SpriteCollection's setting at Runtime