Textbutton with two lines with different align. Is it possible?

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

Textbutton with two lines with different align. Is it possible?

#1 Post by abeplaga » Tue May 28, 2019 2:11 pm

Hi everyone. I'm in trouble trying to do the title thing... Hope if you can help me (or if it's possible to do it).

I want to make a two line textbutton where the first line is aligned to the leftand the second line is aligned to the right, but I don't know how to do it! :oops:

I suppose it'll be something like this but obviously doesn't work.

Code: Select all

textbutton "LINE ONE\n{textalign=1.0}LINE TWO"
textbutton "LINE ONE\n{xalign=1.0}LINE TWO"
Maybe I'm asking an impossible but just in case I ask! Thank you all very much!

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

Re: Textbutton with two lines with different align. Is it possible?

#2 Post by Imperf3kt » Tue May 28, 2019 3:19 pm

You can't do it like that.
Instead, make a container of some sort (I'd suggest a fixed) with xfill True, and place two textbutton inside it; one aligned left, one aligned right.
Then repeat it for further buttons.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Todo list:
Actually finish a project

User avatar
Alex
Lemma-Class Veteran
Posts: 2211
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Textbutton with two lines with different align. Is it possible?

#3 Post by Alex » Tue May 28, 2019 3:37 pm

Or try to put those text lines inside a button - https://www.renpy.org/doc/html/screens.html#button

Code: Select all

    button:
        align(0.5,0.15)
        idle_background gui.idle_color
        hover_background gui.hover_color
        vbox:
            xysize(200,200)
            text "Line 1" align(0.0, 0.2)
            text "Line 2" align(1.0, 0.8)
        action NullAction()

Post Reply

Who is online

Users browsing this forum: No registered users