Grid xfill/yfill confusing me

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
User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Grid xfill/yfill confusing me

#1 Post by vollschauer »

I don't get it.... why is the positioning not in the corners like i would it expect it when using xfill or yfill on the grid.
I basically used the example code from the documentation.

Code: Select all

screen grid_test:

     tag menu

     grid 2 3:
         xfill True
         yfill True

         text "Top-Left"
         text "Top-Right"

         text "Center-Left"
         text "Center-Right"

         text "Bottom-Left"
         text "Bottom-Right"

screen grid_test2:

    $ columns = 2
    $ rows = 1

    grid columns rows:
        xfill True

        for i in range(0, columns * rows):

            frame:
                background "#ffffff"
                xysize (280,38)

label start:

    $ renpy.call_in_new_context("_game_menu", _game_menu_screen="grid_test")

    "Hello, world."

    $ renpy.call_in_new_context("_game_menu", _game_menu_screen="grid_test2")

    return
Screenshot from 2017-03-14 12-46-02.png
Screenshot from 2017-03-14 12-46-23.png
(9.81 KiB) Not downloaded yet

User avatar
gas
Miko-Class Veteran
Posts: 842
Joined: Mon Jan 26, 2009 7:21 pm
Contact:

Re: Grid xfill/yfill confusing me

#2 Post by gas »

mumble... you have to declare the size of the contained elements.
The grid IS stretched in both directions, but doesn't add void space on his own.
The squares are all equal the largest element in the grid, spaced by the spacing property. Nothing else.
If you want to debate on a reply I gave to your posts, please QUOTE ME or i'll not be notified about. << now red so probably you'll see it.

10 ? "RENPY"
20 GOTO 10

RUN

User avatar
vollschauer
Veteran
Posts: 231
Joined: Sun Oct 11, 2015 9:38 am
Github: vollschauer
Contact:

Re: Grid xfill/yfill confusing me

#3 Post by vollschauer »

I see, and I understand and thought by using "xfill True" and having 2 columns, the first is aligned to the left side and the second is aligned to the right side ....that's what I was looking for.

Post Reply

Who is online

Users browsing this forum: bonnie_641, Mingus