How to find x,y coordinates of 4 corners in ipod?

I want to place 4 buttons on top left, top right, bottom left, bottom right corners.

And the button size is 16 x 16. How should I set their x,y coordinates properly?

var redLightRec: Rect;  
var blueLightRec: Rect; 
var greenLightRec: Rect; 
var purpleLightRec: Rect; 

function OnGUI() { 
    GUI.Button(redLightRec, "Red"); 
    GUI.Button(blueLightRec, "Blue"); 
    GUI.Button(greenLightRec, "Green"); 
    GUI.Button(purpleLightRec, "Purple"); 
}

Going off of your other posts in this forum I highly suggest you spend some time here:

http://unity3d.com/support/documentation/

Much of what you’re asking is basic Unity functionality that can be found here.

I saw http://unity3d.com/support/documentation/Components/class-GuiTexture.html

and, did not see the dimension or x,y coordinates of a ipod touch screen.

iPhone resolution is 480 x 320, in landscape mode.

Gui buttons use regular old “pixel” coordinates, so (0, 0) is the top left hand corner, while (480, 320) would be the bottom right corner.

If you know the button size, you can do a little math to determine their placement, or you can simply tweak the X and Y value of each rectangle while your game is running.

Thanks for your great info.

I want to set red (0,0) with button 40,40
blue (440,280)
green (40,0)
purple (440,40)

However, I can only see the blue button placed on the bottom right corner.

do you know why?

310609--10963--$buttons_304.png

I changed green to (0,280, 40, 40) and purple to (440,0,40,40) and it worked fine for me.

I did have to resize my scene window to make it display correctly, but I don’t think you’ll have to do this in Unity iPhone.

Great! I just tried your solution

red 0,0
blue 440,0
green 0,280
purple 440,280

And, I need to drag a big play scene in order to see all the buttons

Thank you very much