I’m currently working for inventory system for my game and to show items I have made icons and would want to put both item name and icon on inventory screen as button.
I’m looking for something like this:
Sorry for bad paint mockup, but I’m on my gf laptop and it lacks civilized graphical programs.
Sry I am late, but the solution is so obvious! Since it’s impossible!
If I get you right you want to create the standard unity-gui button-layout!
A clickable Button with an image, and a text above it?
Well take a closer look at Unity’s buttons, their text elemts are all childed gui text.
So what you need to do is to create your button and than create a gui-text which you than child to the button to make it inherit the button-behaviour.
Else if you’d just overlay it the space where the text is displayed wouldn’t be clickable.
and I simply don’t recommend creating two overlaying buttons, one with an image and the next one with your text.
Always remember that order and childing matters in GUI!
hope this may help,
best wishes,
kayb14
ps: just stumbled across this problem on my own, so I’ll put up the code if I am done figuring it out…