Forum rules - please read before posting.

Empty save game slots image/color placeholders

edited February 2020 in Technical Q&A

Hello,

It's easiest to explain this through visuals, so below is an example of an empty Save slot placeholder image effect I've been attempting to achieve for awhile:
https://imgur.com/a/Z3VVO0c

To recap what's already been done:
Created a Save Menu (with screenshots) in Unity UI. All buttons were connected to AC's Menu Manager.
Save-game screenshots was enabled in in the Settings Manager, and "Label and Screenshots" was selected in the "SavesList" element in the Save Game menu.
Everything is working great in the Save Menu -- the labels are displaying fine and correct screenshots being saved in the slots.

One thing that would make it look more complete are placeholder images (or semi-transparent colored boxes) for blank save slots. Currently they're completely blank except for the "'New Save' text" that's typed in the "SavesList".
Here's a screenshot:
https://imgur.com/a/iRdhcWD

Is there a way of adding placeholder images (or colored boxes) in the empty Save slots? Have been working on this for awhile though haven't been able to achieve it yet. Tried adding other sprites to the Image component, etc.

This screenshot shows the save menu layout in Unity UI:
https://imgur.com/a/rDDv8aA

Any suggestions on adding placeholders are welcome!

Comments

  • What's your AC version? There should be an Empty slot texture field in the SavesList element's list of properties that you can use to set as a placeholder texture.

    However, you can also create separate Image components in your UI that appear in the same space as the ones used to display save screenshots - but underneath. That way, when no screenshot is shown, the separate Image (not linked to AC) will be visible.

  • edited February 2020

    Thank you very much for the information.
    It's AC 1.70.4.

    The Save menu was created in Unity UI.
    When the source of the menu is set to "Unity UI Prefab", the field for "Empty Slot Texture", etc. doesn't appear there and is replaced with "Linked Button Objects" field -- And below those fields is a "Link Graphics to": drop-down menu with options: "Image Component", or "Button Target Graphic".

    Thank you for the second suggestion:
    I did a lot of testing with that, though it doesn't seem possible to add another image behind the Button component since in order for the button to save/show screenshots it seems to to be on the Parent (top level):
    https://imgur.com/a/3xY94fn

    The parent is the bottom-most layer for visuals, any other child layers added with a placeholder image component visually appear on top of this Button/parent (since children further down a hierarchy visually appear above). So it would always display the placeholder image on top.

    Ended up 9-slicing an image in Sprite Editor to create a thin border around the edges and a light grey color interior as a placeholder in empty Save slots -- Technically it's above screenshots, but transparent enough to see a screenshot underneath if there's one in the slot. It works well enough.
    https://imgur.com/a/JlFpu2B

    Thank you for your advice which provided some direction.

  • I suspect that the "Empty Slot Texture" field not showing is a bug - it's used even if the property itself is not exposed.

    Try setting the Source to AC, assigning the texture in the now-exposed field, and then setting the Source back to Unity UI.

  • edited February 2020

    This should do the trick. Didn't realize changing settings under AC set as the source would also have an effect on a Unity UI menu. Not sure I would've made that connection if you hadn't mentioned it, so thank you.

    By the way, if it helps for bug fixing, this is in Unity 2019.3.1f1. Though as far as I remember, it never showed an "Empty Slot Texture" field (with Unity UI prefab as source) in any previous Unity versions I've had (I recall this "empty slot background" issue a while back, and putting it on the backburner for some time while focusing on other parts of the game).

    Hope this helps and thanks!

  • Didn't realize changing settings under AC set as the source would also have an effect on a Unity UI menu.

    It's a bug - fields should show if they have an effect on behaviour. This will be addressed.

    Once set, however, it should work - be sure to have Allow empty slots? checked as well. Keep in mind also that Unity UI may hide a disabled slot by default due to the default Color Tinting settings.

  • edited February 2020

    It did work, by the way. Thank you.

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.