Can't align right inside a hbox (inside a vbox) :(

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
abeplaga
Regular
Posts: 35
Joined: Mon Oct 15, 2018 10:09 am
Contact:

Can't align right inside a hbox (inside a vbox) :(

#1 Post by abeplaga »

Hi, I'm trying to create a small menu with two rows where each has two text buttons, one right aligned and the other to the left but I can't.

I have searched the documentation and in several threads, many of them say that with a xalign 1.0 works but not for me and I don't get it. Am I doing something wrong?

I've made this image in case I don't explain myself well. Thank you in advance!

Image

This is my code:

Code: Select all

vbox:
    xpos 0.5 
    ypos 0.5
    xsize 250
    spacing 15

    hbox:
        textbutton "AAA" action Show("menu_A")
        textbutton "BBB" action Show("menu_B") xalign 1.0 
    hbox:
        textbutton "CCC" action Show("menu_C")
        textbutton "DDD" action Show("menu_D") xalign 1.0

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: Can't align right inside a hbox (inside a vbox) :(

#2 Post by Kia »

hbox only stretches to the size of items in it, you can try adding "xfill True" to them

User avatar
abeplaga
Regular
Posts: 35
Joined: Mon Oct 15, 2018 10:09 am
Contact:

Re: Can't align right inside a hbox (inside a vbox) :(

#3 Post by abeplaga »

Kia wrote: Thu Mar 21, 2019 2:36 pm hbox only stretches to the size of items in it, you can try adding "xfill True" to them
Oh... Well, now I know :D

Thank you, it works!

User avatar
isobellesophia
Miko-Class Veteran
Posts: 979
Joined: Mon Jan 07, 2019 2:55 am
Completed: None
Projects: Maddox and Friends! (AI Teacher friend), Friendly Universities! (Soon)
Organization: Friendly Teachers series
Deviantart: SophBelle
itch: Child Creation
Location: Philippines, Mindanao
Contact:

Re: Can't align right inside a hbox (inside a vbox) :(

#4 Post by isobellesophia »

For vbox just in case, use yfill True either.
I am a friendly user, please respect and have a good day.


Image

Image


Post Reply

Who is online

Users browsing this forum: Google [Bot]