mirror of
https://git.cavemanon.xyz/Cavemanon/SnootGame.git
synced 2025-03-25 11:29:16 +01:00
Fix scrollbar
This commit is contained in:
parent
8c307865af
commit
83e4d77249
1 changed files with 9 additions and 13 deletions
|
@ -51,7 +51,7 @@ init python:
|
||||||
return NOT_UNLOCKED_COVER
|
return NOT_UNLOCKED_COVER
|
||||||
|
|
||||||
scaleFactor = getBoxNormalizerRatio(w, h)
|
scaleFactor = getBoxNormalizerRatio(w, h)
|
||||||
return im.FactorScale("images/cgs/" + fname + "." + ext, scaleFactor["x"], scaleFactor["y"])
|
return im.FactorScale("images/cgs/" + fname + "." + ext, scaleFactor["x"], scaleFactor["y"], False)
|
||||||
|
|
||||||
# Create an object in g:Gallery, add to galleryItems
|
# Create an object in g:Gallery, add to galleryItems
|
||||||
# (imageName: string; ext: string; w: float; h: float; unlocked?: boolean) -> None
|
# (imageName: string; ext: string; w: float; h: float; unlocked?: boolean) -> None
|
||||||
|
@ -136,18 +136,14 @@ screen cg_gallery():
|
||||||
items = len(galleryItems)
|
items = len(galleryItems)
|
||||||
galleryRows = (items / GALLERY_COLS) + 1
|
galleryRows = (items / GALLERY_COLS) + 1
|
||||||
extraSpaces = GALLERY_COLS - (items % GALLERY_COLS)
|
extraSpaces = GALLERY_COLS - (items % GALLERY_COLS)
|
||||||
print items
|
|
||||||
print galleryRows
|
|
||||||
print extraSpaces
|
|
||||||
tag menu
|
tag menu
|
||||||
use game_menu(_("Gallery"), scroll="viewport"):
|
use game_menu(_("Gallery"), scroll="viewport"):
|
||||||
fixed:
|
grid GALLERY_COLS galleryRows:
|
||||||
grid GALLERY_COLS galleryRows:
|
spacing 20
|
||||||
spacing 20
|
for item in galleryItems:
|
||||||
for item in galleryItems:
|
#very slow but once cached, it's 'OK', not ideal
|
||||||
#very slow but once cached, it's 'OK', not ideal
|
add g.make_button(item["item"], item["cg"], xalign = 0.5, yalign = 0.5)
|
||||||
add g.make_button(item["item"], item["cg"], xalign = 0.5, yalign = 0.5)
|
# Add empty items to fill grid after last cg button
|
||||||
# Add empty items to fill grid after last cg button
|
for i in range(0, extraSpaces):
|
||||||
for i in range(0, extraSpaces):
|
null height 20
|
||||||
null height 20
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue