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.