[SOLVED!] Save / Load Screen Transparency behaving oddly?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

[SOLVED!] Save / Load Screen Transparency behaving oddly?

#1 Post by sasquatchii »

Hi,

I am working on coding a save / load screen into my game. It is transparent, so that the background of the game shows whenever you open up the menu, like this:

Image

However, I would like to program both screens to overwrite saves or loads when you click on them (still haven't figured out how to do that, yet!)

But when you click on the save slots in the load screen, the background just goes black, kind of like in this screenshot:

Image

Can anyone help me figure out why this is happening? And is there a way to program an overwrite into the save / load menu code so that players can over write their save / load slots when they click on them?

Here is the code I currently have in place:

Code: Select all

## Load and Save screens #######################################################
##
## These screens are responsible for letting the player save the game and load
## it again. Since they share nearly everything in common, both are implemented
## in terms of a third screen, file_slots.
##
## https://www.renpy.org/doc/html/screen_special.html#save https://
## www.renpy.org/doc/html/screen_special.html#load

screen save():

    tag menu
    zorder 100
    add "gui/coverup.png" 
    imagemap:
        ground "gui/save-inactive.png"
        hover "gui/save-active.png"
        selected_idle "gui/save-active.png"
        alpha True
          
        hotspot (567, 68, 506, 173) clicked FileSave(1):
            use load_save_slot(number=1)

        hotspot (567, 295, 506, 173) clicked FileSave(2):
            use load_save_slot(number=2)

        hotspot (567, 522, 506, 173) clicked FileSave(3):
            use load_save_slot(number=3)
            
        hotspot (567, 749, 506, 173) clicked FileSave(4):
            use load_save_slot(number=4)

        hotspot (1242, 70, 506, 173) clicked FileSave(5):
            use load_save_slot(number=5)

        hotspot (1242, 297, 506, 173) clicked FileSave(6):
            use load_save_slot(number=6)
            
        hotspot (1242, 524, 506, 173) clicked FileSave(7):
            use load_save_slot(number=7)
            
        hotspot (1242, 751, 506, 173) clicked FileSave(8):
            use load_save_slot(number=8)

            
            
        hotspot (828, 942, 55, 55) action FilePage(1)
        hotspot (936, 942, 55, 55) action FilePage(2)
 


        hotspot (90, 424, 304, 62) action Return()
        hotspot (90, 502, 304, 62) action ShowMenu('load')
        
screen load():

    tag menu
    
    add "gui/coverup.png"

    if main_menu:
        add "bg/T7.jpg"
            


    imagemap:
        ground "gui/load-inactive.png"
        hover "gui/load-active.png"
        selected_idle "gui/load-active.png"
        alpha True
          
        hotspot (567, 68, 506, 173) clicked FileLoad(1):
            use load_save_slot(number=1)

        hotspot (567, 295, 506, 173) clicked FileLoad(2):
            use load_save_slot(number=2)

        hotspot (567, 522, 506, 173) clicked FileLoad(3):
            use load_save_slot(number=3)
            
        hotspot (567, 749, 506, 173) clicked FileLoad(4):
            use load_save_slot(number=4)

        hotspot (1242, 70, 506, 173) clicked FileLoad(5):
            use load_save_slot(number=5)

        hotspot (1242, 297, 506, 173) clicked FileLoad(6):
            use load_save_slot(number=6)
            
        hotspot (1242, 524, 506, 173) clicked FileLoad(7):
            use load_save_slot(number=7)
            
        hotspot (1242, 751, 506, 173) clicked FileLoad(8):
            use load_save_slot(number=8)

        hotspot (828, 942, 55, 55) action FilePage(1)
        hotspot (936, 942, 55, 55) action FilePage(2)     
        hotspot (90, 424, 304, 62) action Return()
        hotspot (90, 502, 304, 62) action ShowMenu('save')

screen file_slots(title):

    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))

    use game_menu(title):

        fixed:

            ## This ensures the input will get the enter event before any of the
            ## buttons do.
            order_reverse True

            ## The page name, which can be edited by clicking on a button.
            button:
                style "page_label"

                key_events True
                xalign 0.7
                action page_name_value.Toggle()


            ## Buttons to access other pages.
            hbox:
                style_prefix "page"

                xalign 0.5
                yalign 1.0

                spacing gui.page_spacing

                textbutton _("<") action FilePagePrevious()

                if config.has_autosave:
                    textbutton _("{#auto_page}A") action FilePage("auto")

                if config.has_quicksave:
                    textbutton _("{#quick_page}Q") action FilePage("quick")

                ## range(1, 10) gives the numbers from 1 to 9.
                for page in range(1, 10):
                    textbutton "[page]" action FilePage(page)

                textbutton _(">") action FilePageNext()
                



style page_label is gui_label
style page_label_text is gui_label_text
style page_button is gui_button
style page_button_text is gui_button_text

style slot_button is gui_button
style slot_button_text is gui_button_text
style slot_time_text is slot_button_text
style slot_name_text is slot_button_text

style page_label:
    xpadding 50
    ypadding 3

style page_label_text:
    text_align 0.5
    layout "subtitle"
    hover_color gui.hover_color
    idle_color gui.idle_color

style page_button:
    properties gui.button_properties("page_button")

style page_button_text:
    properties gui.button_text_properties("page_button")

style slot_button:
    properties gui.button_properties("slot_button")

style slot_button_text:
    properties gui.button_text_properties("slot_button")
    
screen load_save_slot:
    key "save_delete" action FileDelete(number)
    $ file_text = "% 2s. %s\n%s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot")),
                        FileSaveName(number))


    
    add FileScreenshot(number) size(221,143) xpos -29 ypos 12
    add AlphaMask("gui/circle_alphamask.png", FileScreenshot(number)) xpos -31 ypos -32
    
    text FileTime(number, format=_("{#file_time}%A, %B %d, %H:%M"), empty=_("")):
        style "slot_time_text" ypos 83 xpos 344

    text FileSaveName(number):
        style "slot_name_text"
    
    
screen game_menu():
    tag menu
    add "gui/pixel.png"


##############################################################################
Any help, ideas, or insight would be greatly appreciated!!!
Last edited by sasquatchii on Thu Feb 22, 2018 9:27 am, edited 1 time in total.
ImageImage

rayminator
Miko-Class Veteran
Posts: 793
Joined: Fri Feb 09, 2018 12:05 am
Location: Canada
Contact:

Re: Save / Load Screen Transparency behaving oddly?

#2 Post by rayminator »

what is the t7.jpg is it black background

i believe if you put an if statement you need the else statement as well i looked at you script there isn't one

so renpy might be over riding the coverup.png background

i might be wrong about the if and else statement

Edit:
I have tried the if statement one my script the if statement does over-ride the main background

try removing the if statement to see what happens

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Save / Load Screen Transparency behaving oddly?

#3 Post by sasquatchii »

rayminator wrote: Mon Feb 19, 2018 9:46 pm try removing the if statement to see what happens
Thanks so much for taking a look at my code and for your help!

I tried removing all of the if statements in the save / load screens, but that did not seem to work.

I uploaded the game folder to google drive if anyone wants to take a look or poke around... it's at https://drive.google.com/open?id=1_Mtqh ... n1NxxBVJk1

If you launch the game, click start (the load screen on the main menu's not up yet) and then click a few times to get off the black screen from the into at the beginning. You can pull up the save / load screens by right clicking. If you click on any save or load slots that already have save/load data on them, the background still goes black. I'm not really sure what's going on :(
ImageImage

irredeemable
Regular
Posts: 78
Joined: Thu Feb 08, 2018 7:57 am
Contact:

Re: Save / Load Screen Transparency behaving oddly?

#4 Post by irredeemable »

FileSave and FileLoad automatically call the yesno_prompt screen. You can't see it on your save screen because you have the zorder set so high. You need to adjust your menu and style the yesno_prompt screen appropriately or turn confirm off (FileSave(x, confirm=False).

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Save / Load Screen Transparency behaving oddly?

#5 Post by sasquatchii »

irredeemable wrote: Thu Feb 22, 2018 12:35 am FileSave and FileLoad automatically call the yesno_prompt screen. You can't see it on your save screen because you have the zorder set so high. You need to adjust your menu and style the yesno_prompt screen appropriately or turn confirm off (FileSave(x, confirm=False).
You are exactly right, thank you so much, irredeemable!! :)
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users