Page 1 of 1

Uneven arrangement of save screenshots

Posted: Tue Dec 11, 2018 4:00 pm
by Valge
Hello! Why they are located uneven grid? I do not really understand what parameter is responsible for this. I would like them to be arranged in a flat grid.

Code: Select all

screen save:
 
    tag menu
   
    add "gui/load_ground.png"
 
    imagemap:
        ground "gui/load_ground.png"
        idle "gui/load_idle.png"
        hover "gui/load_hover.png"
        selected_idle "gui/save_load_selected.png"
        cache False
     
        hotspot (735,965,38,73) clicked FilePage(1)
        hotspot (778,969,53,64) clicked FilePage(2)
        hotspot (829,965,52,69) clicked FilePage(3)
        hotspot (882,966,53,68) clicked FilePage(4)
        hotspot (934,971,51,61) clicked FilePage(5)
        hotspot (985,969,52,65) clicked FilePage(6)
        hotspot (1037,967,48,67) clicked FilePage(7)
        hotspot (1087,965,52,71) clicked FilePage(8)
        hotspot (1139,964,54,74) clicked FilePage(9)
       
        hotspot (127,235,537,305) clicked FileSave(1):
            use load_save_slot(number=1)
        hotspot (692,236,537,304) clicked FileSave(2):
            use load_save_slot(number=2)
        hotspot (1248,235,555,304) clicked FileSave(3):
            use load_save_slot(number=3)
        hotspot (118,603,549,291) clicked FileSave(4):
            use load_save_slot(number=4)
        hotspot (696,601,529,293) clicked FileSave(5):
            use load_save_slot(number=5)
        hotspot (1258,601,535,297) clicked FileSave(6):
            use load_save_slot(number=6)
 
        hotspot (56, 951, 278, 92) action Return()

        hotspot (1191,978,64,50) action FilePageNext(max=9)
        hotspot (668,979,67,47) action FilePagePrevious()

screen load:
 
    tag menu

    add "gui/load_ground.png"
#################################################################################### 
##Code for load screen imagemap
    imagemap:
        ground "gui/load_ground.png"
        idle "gui/load_idle.png"
        hover "gui/load_hover.png"
        selected_idle "gui/save_load_selected.png"
        cache False
     
        hotspot (735,965,38,73) clicked FilePage(1)
        hotspot (778,969,53,64) clicked FilePage(2)
        hotspot (829,965,52,69) clicked FilePage(3)
        hotspot (882,966,53,68) clicked FilePage(4)
        hotspot (934,971,51,61) clicked FilePage(5)
        hotspot (985,969,52,65) clicked FilePage(6)
        hotspot (1037,967,48,67) clicked FilePage(7)
        hotspot (1087,965,52,71) clicked FilePage(8)
        hotspot (1139,964,54,74) clicked FilePage(9)
       
        hotspot (127,235,537,305) clicked FileLoad(1):
            use load_save_slot(number=1)
        hotspot (692,236,537,304) clicked FileLoad(2):
            use load_save_slot(number=2)
        hotspot (1248,235,555,304) clicked FileLoad(3):
            use load_save_slot(number=3)
        hotspot (118,603,549,291) clicked FileLoad(4):
            use load_save_slot(number=4)
        hotspot (696,601,529,293) clicked FileLoad(5):
            use load_save_slot(number=5)
        hotspot (1258,601,535,297) clicked FileLoad(6):
            use load_save_slot(number=6)
        
        hotspot (56, 951, 278, 92) action Return()

        hotspot (1191,978,64,50) action FilePageNext(max=9)
        hotspot (668,979,67,47) action FilePagePrevious() 
       
##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, 6),
                        FileTime(number, empty=_("Пусто")),
                        FileSaveName(number))
 
    #shows a screenshot of the saved game in the save slot
    add FileScreenshot(number) xpos 39 ypos 21
    text file_text xpos 20 ypos 275 size 40 color "#ffffff" outlines [ (2, "#302B54") ] kerning 2 font "fonts/molot.otf"
   
    key "save_delete" action FileDelete(number)
Image

Re: Uneven arrangement of save screenshots

Posted: Sat Dec 15, 2018 12:51 am
by Qlara
The four values represent:
hotspot (x, y, w, h) where x is the position of the object's top left corner on the x-axis, y on the y-axis, w is the object's width and h is its height.
w and h should be the same values for all objects, since you want them to be the same size.
In your image, (1 and 4), (2 and 5), (3 and 6) should have the same x-values, and (1, 2, 3), (4, 5, 6) the same y-values to be aligned.