I am having problems placing the GUI on the iphone. I am trying to place a row of buttons along the bottom of the screen. Here is my simple code: ( I am using horizontal iphone orientation)
// Wrap everything in the designated GUI Area
GUILayout.BeginArea(new Rect(0, (Screen.height-80), Screen.width, 80));
// Begin the singular Horizontal Group
GUILayout.BeginHorizontal();
// Place Buttons
string buttonName = "blahblah ";
for (int i = 0; i <= 6; i++)
{
GUILayout.Button((buttonName+i.ToString()));
}
GUILayout.EndHorizontal();
GUILayout.EndArea();
It is my understanding that the positioning of the Area above using Screen.height should accomplish this. Also because the Area is limited to Screen.width for the with of the area the buttons should stop at the edge of the screen. Neither of the above is happening. Buttons are not at the bottom of the screen (they are about 2/3 down the screen) and they do not end on the right side of the screen.
Now I have read that Viewport in the IDE will not show accurate positioning relative to the iphone if the dimensions are off. So I have configured the viewport to be 480 x 320 (the iphones dimensions) using the “Status” button above the viewport. This changed nothing. The buttons are not positioned properly regardless of whether I look at the viewport in the editor, look at the iphone using Unity Remote, or compile the build and put it on the iphone.
What is the solution to this problem?