Imagemap for Prefs/Save/Load? [SOLVED BY ITSELF]

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
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Imagemap for Prefs/Save/Load? [SOLVED BY ITSELF]

#1 Post by azureXtwilight »

Can I do a save/load screen entirely in imagemap? If yes, then how do I go around in coding it?

There is also this script I got from fuckyeahrenpy tumblr, but it doesn't have buttons for the autosaves and quicksaves :

Code: Select all

## Save, Load
## Screens that allow the user to save and load the game.
 
##Save screen starts here
screen save:
 
    # This ensures that any other menu screen is replaced.
    tag menu
   
    ##Code to add a background image in the save screen
    add "GUI/prefs screen/prefs_bg.png"
 
##Code for save screen imagemap
    imagemap:
        ground "GUI/sl/sl_ground.png"
        idle "GUI/sl/sl_idle.png"
        hover "GUI/sl/sl_hover.png"
        cache False
     
        hotspot (746,67,51,45) clicked FilePage(1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (747,122,50,43) clicked FilePage(2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (747,175,50,46) clicked FilePage(3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (748,231,50,43) clicked FilePage(4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,284,45,45) clicked FilePage(5) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (749,338,47,47) clicked FilePage(6) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (749,390,47,45) clicked FilePage(7) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,446,47,42) clicked FilePage(8) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,500,46,44) clicked FilePage(9) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
       
        hotspot (64,127,301,159) clicked FileSave(1):
            use load_save_slot(number=1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (422,127,303,159) clicked FileSave(2):
            use load_save_slot(number=2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (63,346,303,156) clicked FileSave(3):
            use load_save_slot(number=3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (424,343,300,158) clicked FileSave(4):
            use load_save_slot(number=4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
 
        hotspot (748,1,48,47) action Return() activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
 
##Load screen starts here
screen load:
 
    # This ensures that any other menu screen is replaced.
    tag menu
   
    ##Code to add a background image in the load screen
    add "GUI/prefs screen/prefs_bg.png"
 
##Code for load screen imagemap
    imagemap:
        ground "GUI/sl/sl_ground.png"
        idle "GUI/sl/sl_idle.png"
        hover "GUI/sl/sl_hover.png"
        cache False
     
        hotspot (746,67,51,45) clicked FilePage(1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (747,122,50,43) clicked FilePage(2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (747,175,50,46) clicked FilePage(3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (748,231,50,43) clicked FilePage(4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,284,45,45) clicked FilePage(5) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (749,338,47,47) clicked FilePage(6) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (749,390,47,45) clicked FilePage(7) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,446,47,42) clicked FilePage(8) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (750,500,46,44) clicked FilePage(9) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
       
        hotspot (64,127,301,159) clicked FileLoad(1):
            use load_save_slot(number=1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (422,127,303,159) clicked FileLoad(2):
            use load_save_slot(number=2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (63,346,303,156) clicked FileLoad(3):
            use load_save_slot(number=3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
        hotspot (424,343,300,158) clicked FileLoad(4):
            use load_save_slot(number=4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
 
        hotspot (748,1,48,47) action Return() activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
 
       
##Code to customize the save slots in the save menu
screen load_save_slot:
    #shows information in the save slot about the saved game file
    $ file_text = "% 2s. %s\n%s" % (
                        FileSlotName(number, 4),
                        FileTime(number, empty=_("Empty Slot")),
                        FileSaveName(number))
 
    #shows a screenshot of the saved game in the save slot
    add FileScreenshot(number) xpos 220 ypos 20
    text file_text xpos 0 ypos 10 size 40 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2 font "GUI/sl/Passing Notes.ttf"
   
    key "save_delete" action FileDelete(number) #allows the player to delete a saved game file
   
init -2 python:
    config.thumbnail_width = 180 #width of saved game screenshot to appear in the save slot
    config.thumbnail_height = 150 #height of saved game screenshot to appear in the save slot
Last edited by azureXtwilight on Wed Jul 25, 2018 2:26 am, edited 1 time in total.
Image

User avatar
azureXtwilight
Megane Procrastinator
Posts: 4118
Joined: Fri Mar 28, 2008 4:54 am
Completed: Fantasia series (ROT and ROTA), Doppleganger: Dawn of The Inverted Soul, a2 (a due), Time Labyrinth
Projects: At Regime's End
Organization: Memento-Mori VNs, Team Sleepyhead
Location: Yogyakarta, Indonesia.
Contact:

Re: Imagemap for Prefs/Save/Load?

#2 Post by azureXtwilight »

Never mind! All you gotta do is do this instead:

Code: Select all

screen save():

    tag menu

    # use file_slots(_("Save"))

    add "gui/navi/save.png"

    imagemap:
        ground "gui/navi/navi_ground.png"
        idle "gui/navi/navi_idle.png"
        hover "gui/navi/navi_hover.png"

        hotspot (491, 332, 149, 79) action ShowMenu("save") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (480, 415, 163, 79) action ShowMenu("load") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (403, 496, 229, 80) action ShowMenu("preferences") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (321, 580, 313, 80) action MainMenu() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (486, 663, 152, 78) action Quit() activate_sound "click.mp3" hover_sound "click2.mp3"
    imagemap:
        ground "gui/navi/sl_ground.png"
        idle "gui/navi/sl_idle.png"
        hover "gui/navi/sl_hover.png"
        cache False

        hotspot (1224, 977, 24, 66) clicked FilePage("auto") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1179, 1007, 60, 66) clicked FilePagePrevious() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1822, 977, 63, 66) clicked FilePageNext() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1303, 1000, 75, 73) clicked FilePage("quick") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1389, 1010, 51, 60) clicked FilePage(1) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1448, 1007, 51, 60) clicked FilePage(2) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1512, 1007, 51, 60) clicked FilePage(3) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1572, 1007, 51, 60) clicked FilePage(4) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1634, 1007, 51, 60) clicked FilePage(5) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1697, 1007, 51, 60) clicked FilePage(6) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1765, 1007, 51, 60) clicked FilePage(7) activate_sound "click.mp3" hover_sound "click2.mp3"

        hotspot (721, 140, 1171, 263) clicked FileSave(1) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=1)
        hotspot (721, 419, 1171, 263) clicked FileSave(2) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=2)
        hotspot (721, 711, 1171, 263) clicked FileSave(3) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=3)



screen load():

    tag menu

    # use file_slots(_("Load"))

    add "gui/navi/load.png"

    imagemap:
        ground "gui/navi/navi_ground.png"
        idle "gui/navi/navi_idle.png"
        hover "gui/navi/navi_hover.png"

        hotspot (491, 332, 149, 79) action ShowMenu("save") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (480, 415, 163, 79) action ShowMenu("load") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (403, 496, 229, 80) action ShowMenu("preferences") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (321, 580, 313, 80) action MainMenu() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (486, 663, 152, 78) action Quit() activate_sound "click.mp3" hover_sound "click2.mp3"
    imagemap:
        ground "gui/navi/sl_ground.png"
        idle "gui/navi/sl_idle.png"
        hover "gui/navi/sl_hover.png"
        cache False

        hotspot (1224, 977, 24, 66) clicked FilePage("auto") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1179, 1007, 60, 66) clicked FilePagePrevious() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1822, 977, 63, 66) clicked FilePageNext() activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1303, 1000, 75, 73) clicked FilePage("quick") activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1389, 1010, 51, 60) clicked FilePage(1) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1448, 1007, 51, 60) clicked FilePage(2) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1512, 1007, 51, 60) clicked FilePage(3) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1572, 1007, 51, 60) clicked FilePage(4) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1634, 1007, 51, 60) clicked FilePage(5) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1697, 1007, 51, 60) clicked FilePage(6) activate_sound "click.mp3" hover_sound "click2.mp3"
        hotspot (1765, 1007, 51, 60) clicked FilePage(7) activate_sound "click.mp3" hover_sound "click2.mp3"

        hotspot (721, 140, 1171, 263) clicked FileLoad(1) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=1)
        hotspot (721, 419, 1171, 263) clicked FileLoad(2) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=2)
        hotspot (721, 711, 1171, 263) clicked FileLoad(3) activate_sound "click.mp3" hover_sound "click2.mp3":
            use load_save_slot(number=3)

        #hotspot (#,#,#,#) action Return() activate_sound "FILE NAME HERE" hover_sound "FILE NAME HERE"


screen load_save_slot:
    $ file_text = "% 2s. %s\n%s" % (
                        FileSlotName(number, 3),
                        FileTime(number, empty=_("Empty Slot")),
                        FileSaveName(number))

    add FileScreenshot(number) xpos 700 ypos 25
    text file_text xpos 200 ypos 100 size 40 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2

    key "save_delete" action FileDelete(number)

init -2 python:

    config.thumbnail_height = 100
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]