- Home /
Fit to screen script?
I have gotten a GUI Window going and all but on an iPhone app the screen could shift oreintation. So I want to know a fit to screen script for a GUI Window...
Answer by Mike 3 · Jun 24, 2010 at 12:55 PM
All you have to do is this:
var windowRect = Rect(0, 0, Screen.width, Screen.height);
use windowRect for the window's rect
this seems to set the width to 752 and height to 272 ??? What is wrong?
if you put it at the top of your script it'll return junk - use it in OnGUI exactly like that and it should be fine
(or declare the variable at the top of your script, and set it in OnGUI or Update - either way, you need to keep polling it as it'll change when the orientation changes)
Your answer
Follow this Question
Related Questions
How to create 3D game object in specified pixel size? 2 Answers
Handling iPhone / iPad screen sizes? 0 Answers
how to reduce library size? 2 Answers
Change the size of a custom font in a Canvas text 1 Answer
My iPA is much larger than my apk 0 Answers