iPad development on laptop size screen

39 views
Skip to first unread message

John Grden

unread,
Dec 26, 2010, 10:57:17 AM12/26/10
to unity3d-d...@googlegroups.com
I'm working on an iPad "tall" app and am on a laptop - I can set it to 3:4 and the 3D view scales, but of course the GUI elements don't.  The app isn't a multi-device app and I have to work with positioning elements.  If I set it to true iPad Tall, I can see 2/3 of the screen, but of course can't scroll / reposition to see the bottom.  Scaling to use 3:4 iPad Tall is useless as well.

Any tips/tricks people are using to overcome this issue?

I've looked on the forum, found code to resize GUI for resolution independence but that seems extreme especially since it's not a requirement on the project.

Thanks for the help,

John

--
[  JPG  ]

John Grden

unread,
Dec 26, 2010, 10:22:28 PM12/26/10
to unity3d-d...@googlegroups.com
Well, as it turns out, this is very simple to do.  I've added this to my OnGUI() handler and it works fine:

OriginalScreenWIdth = 768;
OriginalScreenHeight = 1024;
widthScale = Screen.width / OriginalScreenWidth;
heightScale = Screen.height / OriginalScreenHeight;

GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(widthScale, heightScale, 1.0f));
       
rectToUse = CurrentRect;

// example of centering 
if( centerDisplay )
     rectToUse = new Rect( (OriginalScreenWidth*.5f) - (CurrentRect.width*.5f),
                                    CurrentRect.y,
                                    CurrentRect.width,
                                    CurrentRect.height);

Just remember that you're still working with your original screen size/area

hth,

John
--
[  JPG  ]
Reply all
Reply to author
Forward
0 new messages