Guest User

Coding for Save/Load Screen Imagemap (Ren'Py)

a guest
May 24th, 2014
2,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.70 KB | None | 0 0
  1. ## Save, Load
  2. ## Screens that allow the user to save and load the game.
  3.  
  4. ##Save screen starts here
  5. screen save:
  6.  
  7.     # This ensures that any other menu screen is replaced.
  8.     tag menu
  9.    
  10.     ##Code to add a background image in the save screen
  11.     add "GUI/prefs screen/prefs_bg.png"
  12.  
  13. ##Code for save screen imagemap
  14.     imagemap:
  15.         ground "GUI/sl/sl_ground.png"
  16.         idle "GUI/sl/sl_idle.png"
  17.         hover "GUI/sl/sl_hover.png"
  18.         cache False
  19.      
  20.         hotspot (746,67,51,45) clicked FilePage(1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  21.         hotspot (747,122,50,43) clicked FilePage(2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  22.         hotspot (747,175,50,46) clicked FilePage(3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  23.         hotspot (748,231,50,43) clicked FilePage(4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  24.         hotspot (750,284,45,45) clicked FilePage(5) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  25.         hotspot (749,338,47,47) clicked FilePage(6) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  26.         hotspot (749,390,47,45) clicked FilePage(7) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  27.         hotspot (750,446,47,42) clicked FilePage(8) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  28.         hotspot (750,500,46,44) clicked FilePage(9) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  29.        
  30.         hotspot (64,127,301,159) clicked FileSave(1):
  31.             use load_save_slot(number=1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  32.         hotspot (422,127,303,159) clicked FileSave(2):
  33.             use load_save_slot(number=2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  34.         hotspot (63,346,303,156) clicked FileSave(3):
  35.             use load_save_slot(number=3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  36.         hotspot (424,343,300,158) clicked FileSave(4):
  37.             use load_save_slot(number=4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  38.  
  39.         hotspot (748,1,48,47) action Return() activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  40.  
  41. ##Load screen starts here
  42. screen load:
  43.  
  44.     # This ensures that any other menu screen is replaced.
  45.     tag menu
  46.    
  47.     ##Code to add a background image in the load screen
  48.     add "GUI/prefs screen/prefs_bg.png"
  49.  
  50. ##Code for load screen imagemap
  51.     imagemap:
  52.         ground "GUI/sl/sl_ground.png"
  53.         idle "GUI/sl/sl_idle.png"
  54.         hover "GUI/sl/sl_hover.png"
  55.         cache False
  56.      
  57.         hotspot (746,67,51,45) clicked FilePage(1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  58.         hotspot (747,122,50,43) clicked FilePage(2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  59.         hotspot (747,175,50,46) clicked FilePage(3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  60.         hotspot (748,231,50,43) clicked FilePage(4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  61.         hotspot (750,284,45,45) clicked FilePage(5) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  62.         hotspot (749,338,47,47) clicked FilePage(6) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  63.         hotspot (749,390,47,45) clicked FilePage(7) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  64.         hotspot (750,446,47,42) clicked FilePage(8) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  65.         hotspot (750,500,46,44) clicked FilePage(9) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  66.        
  67.         hotspot (64,127,301,159) clicked FileLoad(1):
  68.             use load_save_slot(number=1) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  69.         hotspot (422,127,303,159) clicked FileLoad(2):
  70.             use load_save_slot(number=2) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  71.         hotspot (63,346,303,156) clicked FileLoad(3):
  72.             use load_save_slot(number=3) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  73.         hotspot (424,343,300,158) clicked FileLoad(4):
  74.             use load_save_slot(number=4) activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  75.  
  76.         hotspot (748,1,48,47) action Return() activate_sound "GUI/sl/save-activate.mp3" hover_sound "GUI/sl/save-hover.mp3"
  77.  
  78.        
  79. ##Code to customize the save slots in the save menu
  80. screen load_save_slot:
  81.     #shows information in the save slot about the saved game file
  82.     $ file_text = "% 2s. %s\n%s" % (
  83.                         FileSlotName(number, 4),
  84.                         FileTime(number, empty=_("Empty Slot")),
  85.                         FileSaveName(number))
  86.  
  87.     #shows a screenshot of the saved game in the save slot
  88.     add FileScreenshot(number) xpos 220 ypos 20
  89.     text file_text xpos 0 ypos 10 size 40 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2 font "GUI/sl/Passing Notes.ttf"
  90.    
  91.     key "save_delete" action FileDelete(number) #allows the player to delete a saved game file
  92.    
  93. init -2 python:
  94.     config.thumbnail_width = 180 #width of saved game screenshot to appear in the save slot
  95.     config.thumbnail_height = 150 #height of saved game screenshot to appear in the save slot
Advertisement
Add Comment
Please, Sign In to add comment