- Home /
The Transparent boarder in a button
Hi.
I'm making some button for my HUD using "GUI.Button" function. I made a texture for it using photoshop. How can I make a button just using this texture. I mean, I don't want the transparent boarder. How can I omit it?
Answer by flamy · Dec 23, 2011 at 06:13 AM
GUI.Button(Rect (x,y,width,height),Your_image,GUIStyle.none); add GUIStyle.none at the end, you button will now be only the texture!
Answer by charnew · Dec 23, 2011 at 06:28 AM
on the project view, right click Create-> GUISkin
drag this asset on the default references
on the inspector, you can modify your button, either normal, hover, active or focused. You can change the texture to none.
then add this on your script:
var [name of your gui skin] : GUISkin;
function OnGUI () {
GUI.skin = [name of your gui skin];
Your answer
Follow this Question
Related Questions
gui text button dont work 1 Answer
GUI click through? 3 Answers
Button onClick events will not be triggered 1 Answer
Get rid of GUIButtons more efficiently 3 Answers