[SOLVED] Specifying vpgrid width?

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
HammeredEnt
Regular
Posts: 33
Joined: Sat May 04, 2019 8:09 am
Contact:

[SOLVED] Specifying vpgrid width?

#1 Post by HammeredEnt »

Hi all,

I'm trying to use a vpgrid but I can't seem to get it positioned right - the cells just bunch up over to the right of the screen rather than spread across the area that I want it to (as indicated by the graphic behind it. I've tried using the 'xsize' option but that didn't seem to do anything helpful - it just squished things over further and made it unreadable.


Image

Code: Select all

screen armorinit():

    add "armormenu" at center
    vpgrid:
        cols 2
        ysize 0.85
        xspacing 20
        yspacing 40
        draggable True
        mousewheel True
        scrollbars "vertical"
        side_xalign 0.2
        side_yalign 0.3
Any help would be greatly appreciated!
Last edited by HammeredEnt on Mon Jul 15, 2019 7:24 am, edited 1 time in total.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3794
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Specifying vpgrid width?

#2 Post by Imperf3kt »

From the documentation, a vpgrid sizes itself based on its children (the stuff you put in it)
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

HammeredEnt
Regular
Posts: 33
Joined: Sat May 04, 2019 8:09 am
Contact:

Re: Specifying vpgrid width?

#3 Post by HammeredEnt »

And yet it's still getting all bunched up like this when they're clearly bigger...

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Specifying vpgrid width?

#4 Post by PyTom »

A vpgrid can only be used with children that are all the same size, and it picks the size of the children from the size of the first child.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

HammeredEnt
Regular
Posts: 33
Joined: Sat May 04, 2019 8:09 am
Contact:

Re: Specifying vpgrid width?

#5 Post by HammeredEnt »

Ah-hah! It was the 'first child' bit that I was messing up - I thought it would size to the largest of all children rather than just the first one. Problem solved - just add in some 'junk' space on the first child to make it work. Thanks PyTom!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]