GUI texture with counter

Hey guys I have a quick question. I’m working on my money system but would like to have an image of the currency being collected instead of the GUIlabel.

For instance if I have gold as my currency I want an icon on my inventory window with the amount next to it. I currently have it as a text and tried to do the research with the script commands but everything I try throws an error. This is how I currently have it coded.

GUI.Label(Rect(MoneyNamePosition.x, MoneyNamePosition.y, MoneyNameSize.x, MoneyNameSize.y), “Money:” + Player_Inventory.players_money.ToString());

Any help is appreciated.

Don’t why that wouldn’t work, just make sure you have it in the OnGUI() function otherwise you should list your error so people could get an idea of what’s going wrong.

Look for the overload of GUI.Label method having the GUIContent argument:

static function Label (position : Rect, content : GUIContent, style : GUIStyle) : void

(GUIContent can hold both image and text)

Thanks dkozar that solved it. Great work.