Trying to make a picture button with text.

I’m working on an inventory system which combines objects of the same type into a stack.
Basically I want an inventory button which displays the Item’s count over the graphic.

Here is the General Code Idea:

if (Inventory.Items[counter].Stack_Count > 1)
{
		if (GUILayout.Button ( new GUIContent("" + Inventory.Items[counter].Stack_Count, Inventory.Items[counter].gui_icon,  "Qty:" 
                 + Inventory.Items[counter].Stack_Count), GUILayout.MaxWidth(Inv_But_Dim.x), GUILayout.MaxHeight(Inv_But_Dim.y)))
	{
							Inventory.UseItem(counter);
	}
						
}

I do not want the quanitity as a tooltip because the player would be taken from the action. How would I go about putting the stack number over the graphic? When put the item count into the box, the button puts two items in the same box. I want the image Behind the text, not beside it. Look at the image below… see what I mean? I also want the QTY count aligned to the top left.

1239486--52837--$Inventory_Image.jpg

Just draw another GUI.Label on top with object count.

I would but I’m using a Unity autolayout. How do I do that in an autolayout script design?

You can’t, don’t use Layout.

You can. Immediately after the Button do

Rect r = GUILayoutUtility.GetLastRect(); //Get the Rect of the previous GUILayout element

And then use that rect to draw a non-GUILayout label on top of the button…

thanks. i wish i knew that two weeks ago