GUI Size And Scrolling Problem

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
kylemercury
Regular
Posts: 39
Joined: Tue Jul 11, 2017 11:19 pm
Contact:

GUI Size And Scrolling Problem

#1 Post by kylemercury »

Hello!
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")
the "lightbox_image variable is just the trigger to go between displaying one image and the grid of images

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)

cheonbyeol
Regular
Posts: 37
Joined: Thu Feb 04, 2021 9:04 am
Contact:

Re: GUI Size And Scrolling Problem

#2 Post by cheonbyeol »

What will help you out is a vpgrid. It can scroll and has a grid built in.

kylemercury
Regular
Posts: 39
Joined: Tue Jul 11, 2017 11:19 pm
Contact:

Re: GUI Size And Scrolling Problem

#3 Post by kylemercury »

cheonbyeol wrote: Thu Feb 18, 2021 4:51 pm What will help you out is a vpgrid. It can scroll and has a grid built in.
Thank you I'll check that out!

Post Reply

Who is online

Users browsing this forum: Google [Bot]