- Home /
Planning GUI position for iOS
I am making a 2d game made with some GUI elements. I just built the project for the iPhone 5 and the positioning is off. How do I position the GUI with javascript or in the game editor? Also how does the game editor screen translate to the iOS device screens? This will help me figure out if I place a GUI button somewhere in the editor where it will appear on an iOS device's screen.
Can you post what you have now, and explain what part is off? As for testing in a similar environment for the iPhone, you can change your Game window aspect ratio to match that of an iOS. There's a small button in the upper left corner of the Game window to select aspect ratio. Note that if you use screen width/height values from code, they will still be relative to your computer monitor, not the iOS, and the only way I've found to fix that is to iteratively shrink the game window (undocked) until the width/height match your iPhone resolution. Then your pixel-based equations will work.
I have the game editor in free aspect mode and with the GUI buttons I have buttons in a 5 X 5 grid at exactly the middle of the screen because I used it with Screen.width and Screen.height
Answer by fifthknotch · Mar 12, 2014 at 04:51 AM
Instead of using free aspect mode, create a custom aspect ratio 1136 x 640. That is the resolution of the iPhone 5 wide view. Then, position your GUI to look right in your editor. It will carry over to your iPhone correctly since the resolution is the same.