[SOLVED] vbox ignoring x and y align

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
Dr_arell
Regular
Posts: 70
Joined: Sun Feb 23, 2020 11:24 pm
Deviantart: DarellArt
Contact:

[SOLVED] vbox ignoring x and y align

#1 Post by Dr_arell » Thu May 20, 2021 8:01 pm

I got this screen defined, please pay attention to the vbox that contains the imagebuttons and the buttons. I tried making a button and placing it inside a vbox, the vbox was already placed with xalign and yalign, when i created the button the vbox stopped taking xalign and yalign and just decided to move at the top left of the screen, the button worked but now i cant move my vbox for some reason even though it has placements properties.

Code: Select all

screen ui_base():

    vbox:
        spacing 30
        yalign 0.5
        xalign 0.1
        imagebutton:
            idle "/images/screens/Store/menu_button.png" action SetVariable("menu_", clothes), Hide("inventory"), Show("store") focus_mask True

        imagebutton:
            idle "/images/screens/Store/menu_button.png" action SetVariable("menu_", technology), Hide("inventory"), Show("store") focus_mask True

        imagebutton:
            idle "/images/screens/Store/menu_button.png" action Hide("store"), Show("inventory") focus_mask True

        imagebutton:
            idle "/images/screens/Store/menu_button.png" action Hide("store"), Hide("inventory"), Hide("store"), Hide("ui_base") focus_mask True

        button:
            action Hide("store"), Hide("inventory"), Hide("store"), Hide("ui_base") focus_mask True
            add "/images/screens/Store/menu_button.png"
            text "Exit" xoffset 130 bold True
Last edited by Dr_arell on Thu May 20, 2021 10:08 pm, edited 1 time in total.

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

Re: vbox ignoring x and y align

#2 Post by Imperf3kt » Thu May 20, 2021 8:19 pm

You haven't defined any size / area for your vbox to occupy, so it is filling out all available space in an x and y direction. In your case, 10% below the screen top and all the way to the left for Y axis.

You need to constrain the vbox's proportions, or aligning it won't do any good.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor
Free Android GUI - Updated occasionally
Twitter
Imperf3kt Blackjack - a WIP blackjack game for Android made using Ren'Py

Dr_arell
Regular
Posts: 70
Joined: Sun Feb 23, 2020 11:24 pm
Deviantart: DarellArt
Contact:

Re: [SOLVED] vbox ignoring x and y align

#3 Post by Dr_arell » Thu May 20, 2021 10:09 pm

thank you, i defined the size and now i can move it around.

Post Reply

Who is online

Users browsing this forum: mold.FF