- Home /
GUI button for Android?
hi. is there some way to make a GUI button work for Android/IOS?
so this will work fine?
if (GUI.Button(10,10,10,10),"Text")) { Do something }
Yeah, works exactly the same. You may want to avoid using OnGUI on phones tho, its pretty intensive
Is there then something else that I can use ins$$anonymous$$d?
Answer by DisruptionGames · Aug 19, 2012 at 12:45 PM
In Unity. Most all of the GUI is actually implemented in all of the systems that it supports. So:
if(GUI.Button(Rect(0,0,100,20),"Example")){
//Do Method
}
Works completely.
:S I copied your text where there was many weird signs and then it fixed it. I used this way and it works great ;D
"Example" is the output string on the actual button that you use. So you can change it to anything you want. You can even make a variable and implement that. And or texture too. You can find out more by reading the documentation: http://docs.unity3d.com/Documentation/ScriptReference/GUI.Button.html
Thanks ;) Today I changed all my 3d text buttons to GUI buttons and they work great ;D Hopefully I'll be able to test it on a phone soon.
Awesome! Well you can message me on skype if you need any help with anything else: DevonJavaScript
Your answer
![](https://koobas.hobune.stream/wayback/20220613075844im_/https://answers.unity.com/themes/thub/images/avi.jpg)