- Home /
DrawTexture GUI iPhone
So I have a main GUI scene, and I am drawing a texture with GUI.DrawTexture for the full background. I then need to draw four touchable buttons, without using the GUITexture's, since (i think) you can't make them certain screen widths and screen heights. I would make them GUI.Button, but once again (I think) you can't make them touchable with iphones... Any help would be great! Ps. I work with javascript
Comment
Answer by SolidSnake · Aug 16, 2012 at 03:33 PM
GUI.Button works with iPhone... simply draw things in the right order You can use GUIStyle to style your button with the textures for normal/active states and font For Example:
function OnGUI()
{
// draw background texture (iPhone 3GS resolution)
GUI.DrawTexture(new Rect(0,0,320,460),myBackTexture);
// draw a button
if(GUI.Button(new Rect(20,20,100,50),"my button title",MyButtonStyle))
{
// button touched do something
}
}