- Home /
I'd like a GUI like this
Hello everybody,
how can I make a circular button/group/window instead of a rectangular one? :)
Many thanks, Giancarlo
Comment
how do you mean? example screen shot or something please
GUI is pretty cut and dry as far as building alternative structures. Building a circular hud is really just a matter of doing the math to calculate positions.
Answer by lampshade · Oct 25, 2010 at 04:58 AM
let this code assume you have a circle texture and have dragged and dropped it into the inspector la.
public class CircleGUI : MonoBehaviour { public Texture2D MyCircle;
private void OnGUI()
{
// Draw Circle in the middle of the screen if I remember correctly.
GUI.DrawTexture(new Rect((Screen.width/2)-50,(Screen.height/2),50,50)), MyCircle);
}
}