I'm running into a bit of a problem displaying my items' icons in my main menu.

image
image


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.
  • From the images I'd say your setup is generally a bit wrong.
    You seem to have a UI Box (the Portrait Box) within a UI Box (the root Description Menu Box).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Oh, erm, this is a bit awkward, but you were the one who set the prefab up for me, haha. But I was afraid of touching/changing much and only tweaked some basic things like dimensions of the boxes, colors, etc...

    What should I change? Should I remove the Portrait Box/UI Box, and replace it with a Makinom/HUD/Content/Portrait Content?
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Yeah ... that's awkward - I don't remember setting up a UI box prefab for anyone and sending it to them :D

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Alright I added a portrait from the scene hierarchy, and even though it shows up, it doesn't display the sprite I'm using in the item's settings.

    Here are the settings I have in the portrait object and the root UI Box:

    image
    image

    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:

    image


    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.

    image

    Any ideas on what else I can check to get that sprite to appear?

    Thanks as always, GiL! You're the best!
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Ah, that project, yeah - I remember now :D

    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.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited September 2022
    Alright, I changed the menu to use Normal1 and the item to use Normal1 as well, for the portrait types. I removed that additional portrait as well, so there's only one listed in the UI Box.

    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.

    image

    I double checked the UI Box settings.

    image

    And did the same with the sprite itself.

    image


    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.
    Post edited by LostForest on
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
  • Make sure you're setting up to use portraits in the correct menu part. E.g. if the portraits are part of the description box (not the item box), that needs to be set up in the Description menu part.

    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
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • That did the trick! I was activating portraits for the item box, but not the description box. I didn't realize they were separate in the Item Menu menu-screen settings.

    Thank you so, so much, GiL! You're always such a big help!
    Agender, curry fan, Top 10 lister, indie dev, gym hitter, musician, et al.
Sign In or Register to comment.