Forum rules - please read before posting.

Changing Inventory Font

edited December 2017 in Technical Q&A
Hi there,

I have no idea where to change the font used to display inventory item names on hover.
The InventoryBox element doesn't have a slot for selecting a font when using Unity UI prefab.
I didn't find anything font-related in the Inventory Manager, either.
I didn't find anything font-related in the Settings Manager, either.

Using the Unity UI prefab and selecting "Icon and Text" for Display Type will actually display the correct item name in the correct font of the Unity UI prefab's Text component.
Unfortunately item names will then be displayed continuously as long as the inventory remains open.
If "Icon only" is selected for Display Type, it will correctly display the item names on hover only - but using AC's default font, at the position of the mouse cursor, not the position of the Unity UI prefab's Text component.

I have tried to find a GUI skin in the AC assets to maybe replace the default font there, with no luck.

I tried searching the forum for similar issues.

I will create a new Unity UI prefab.
Maybe I forgot to assign something...

Do I have to manually link each slot's Text-child to a seperate Label element set to Inventory Property and also set up an Inventory Property with a string of the inventory item name?
Because that seem like a lot of unnecessary effort for something that shouldn't be an issue in the first place...

I'd be so happy if I just made a stupid mistake somewhere and there is a really simple solution to this.

I just can't see it...

Comments

  • I noticed AC default inventory prefab doesn't have any Text assigned to its buttons/slots.
    This confuses me.
  • Welcome to the community, @JulianRoeth.

    When dealing with Unity UI-based Menus, all styling options e.g. font size, colour etc, are left to the UI canvas that gets supplied - as opposed to any field in your Managers.  The intention with the Unity UI mode is to offer the user greater stylistic control, at the cost of convenience of assigning fields there in the Menu Manager.

    The "Icon And Text" display option for an InventoryBox element will indeed show each item's label while it's open - that's independent from whether or not an item is selected.

    When you assign a UI Button component to an AC menu element, AC will automatically find the Text component as a child object of it - no need to manually assign the Text child yourself.

    The default Inventory UI prefab is icon-based, so no Text components are necessary.  However, you can still display the selected item's name with a Hotspot menu / label.  A Label element with a type set to "Hotspot" will cause that label to take the display name of whatever the active interactive object - which includes both Hotspots and inventory items.  AC's default Hotspot Menu also works with Unity UI, and you can test this out by switching the Source when the 3D Demo game is loaded (Managers + scene).  When you pick up the sword in the corner of the room, you can hover over it with the mouse to display it's name.

    This Hotspot UI can also be restyled and repositioned to suit.  By default it is set to appear at the cursor's position.

    If you've been having this problem, was something wrong with the Hotspot Menu?  If you'd like to share more about what you have so far, I'd be happy to advise further.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.