I’ve been playing with the GUI a bit for now,I want to show the clips and ammo without rect or anything.I just want the number on its own,how can I do that? oh and can anyone tell me a good website to learn from c#? thanks
Theoretically it is possible to create a GUISkin and use the GUILayout methods with your custom styles, in which you determine offsets etc. to show the GUIElements in correct positions. However, it would probably be easier if you just used Rects… You will run into problems later on, especially if creating complex GUIs.
You can learn basic C# syntax from C# - Basic Syntax
This is probably the easiest way I can think of doing it. It’s practically imperative to use Rect()
using System.Collections;
using UnityEngine;
public class HUD
{
public GUISkin mySkin;
public int x,y,width,height;
public String health, ammo, clips;
private void SetBox()
{
x = ;
y = ;
width = ;
height = ;
}
void OnGUI()
{
GUI.skin = mySkin;
SetBox();
GUI.Label(new Rect(width,height,x,y), health + " " + ammo + " " + clips);
}
}