Forum rules - please read before posting.

Save game menu and Show "New save" option

Hi everyone,
AC 1.70.0 + Unity 2019.2.17f1 on a 2d game.
Actually I made the new Unity UI Menu, in particular Save Menu.
This is how it is now: https://drive.google.com/open?id=1sxRUuw1rHlBexJn__CI1QGXPPIWjUG7L
The white square are the images (screenshots).

I have a little issue with the option Show "New save" option. Here the result of the above menu: https://drive.google.com/open?id=16Ry6d3ngDTrGCaXhd80dOZmbbu6MFLEh

Pratically in the slot for the new save there isn't the image and so the text seems to be not centered on the menu.
Is there a way to tell to AC how to put the text "New save", indipendently from the other slots (so I can center the text), or to add the images (screenshots) like the above slots? I would need one of the two solutions: or centered text ("New save" centered to the menu, like the "back" word), or the same of the other slots (combo image + text, where the images is empty (a light white for example)).

Thank you very much.

Comments

  • If you decide to go for the second option and add a blank save placeholder image / color (light white color like you mentioned) in your Unity UI menu, I asked about something similar -- how to add a placeholder color / or image in empty new save slots.
    Feel free to check it out here

  • The former would require a custom script to dynamically show/hide the Image component based on whether or not its a "New save slot".

    Try attaching this to each of the save slot Image component, and set the "Save Slot" fields in the Inspector to match:

    using UnityEngine;
    using UnityEngine.UI;
    using AC;
    
    public class ToggleScreenshotImage : MonoBehaviour
    {
    
        public int saveSlot;
    
        void OnEnable ()
        {
            bool showImage = (saveSlot != KickStarter.saveSystem.GetNumSaves ());
            GetComponent <Image>().enabled = showImage;
        }
    
    }
    

    You'd then have to rely on Unity's Horizontal Layout Group component to have the Text change shape accordingly.

    For the second, this is possible via the "Empty slot texture" field but there is currently a bug that stops this from being visible in the properties. As a temporary workaround, set the Menu's Source back to Adventure Creator, assign the texture into the now-visible property, then set if back to Unity UI Prefab.

  • Thank you ChrisIceBox and heyitsjayy: the second solution (the empty texture with workaround) works very well.

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.
Do NOT follow this link or you will be banned from the site!