I'm making a game where you can find pictures and display them on your phone(in game). Using some code from a tutorial I found I am able to display
the images in a grid quite nicely, however as you'll see below the images continue beyond the confines of the phone itself. So I'd like to make the bottom
of the grid cut off before the "Return" button and simply make the screen draggable and scrollable to see the lower images. I feel like it's a simple fix but I can't really figure it out. I've played with the ysize of the screen and style but that just changes the size of the phone itself. I'd really appreciate any kind of help or suggestions, thanks!
I can't figure out how to paste images here so here's a link to the image of the phone: https://imgur.com/MndGTBF
When not displaying a single image, here's the code for the screen to display the images in a grid
Code: Select all
screen gameGallery():
zorder 2
modal True
frame:
style "phonegui"
grid 2 len(phone_pictures)/2 + 1:
spacing 20
xalign 0.5
yalign 0.1
ysize 500
for q in phone_pictures:
$ qimage = "galleryimages/" + q + ".png"
$ Ib_image = im.Scale(qimage, 180, 220)
imagebutton:
idle Ib_image
hover Ib_image
action SetVariable("lightbox_image", q)
for i in range(0, (len(phone_pictures)/2 + 1) * 2 - (len(phone_pictures))):
null
textbutton _("Return"):
xalign 0.5 ypos 700
xfill False
action Jump("gotophonefromcontacts")
Also, I'm not sure if it's needed but here's the "phonegui" style code
Code: Select all
style phonegui:
xpadding 150
top_padding 100
xsize 406
ysize 829
xalign 0.5
yalign 0.1
padding gui.frame_borders.padding
background Frame("gui/items/bigboyphone.png", gui.frame_borders, tile=gui.frame_tile)