I'm running into a bit of a problem displaying my items' icons in my main menu.
I'm trying to get a medium-sized portrait for it to display in the bottom right square on the bottom menu box, however I can't figure out how to do so. It simply won't show up at all.
Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
You seem to have a UI Box (the Portrait Box) within a UI Box (the root Description Menu Box).
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
What should I change? Should I remove the Portrait Box/UI Box, and replace it with a Makinom/HUD/Content/Portrait Content?
Anyway, best to remove the additional UI boxes completely and add a portrait content to your root UI box via the scene hierarchy context menu.
Maybe even restart the UI box setup from scratch - otherwise check your root UI Box component (which should be the only such component on the entire prefab) and make sure the new portrait content is added to the portrait setup there.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Here are the settings I have in the portrait object and the root UI Box:
And just for good measure, here's the item I'm testing. I'm not sure if there was anything else I need to change in its settings besides setting a portrait:
The portrait object IS showing up in-game, however it just won't display the sprite I'm using. If I change the color of the image component, it changes in-game.
Any ideas on what else I can check to get that sprite to appear?
Thanks as always, GiL! You're the best!
I see the following issues:
1) On the UI Box component in the Portrait Content settings.
I think you've added the same UI Portrait as main content and additional content. Not 100% sure if this will cause an issue if your menu (or whatever uses the UI box) only has a main portrait, but you should remove the Additional Portrait if it's referencing the same component.
2) The item has no Portrait Type selected.
I guess this is in a menu screen, so make sure the menu displaying the portrait uses a portrait type that's used by the item's portrait.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Still nothing. Interestingly, if I select "Disable if Empty", then the box doesn't show up period, not even the white placeholder box. However, if I set the item to use the same sprite as its "Icon" in the inventory settings, the sprite works as the icon, but still not as the portrait.
I double checked the UI Box settings.
And did the same with the sprite itself.
This is on the item menu, in the main menu. Specifically a description box that pops up on the bottom of the screen when selecting an item.
Did a quick test with the old project I made for you and worked fine - what I did:
- added sprite portrait content to the description box prefab (via context menu)
- added portraits to some items
- used that portrait type to show portraits in the description menu part of the item menu
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you so, so much, GiL! You're always such a big help!