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

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

#1 Post by abeplaga »

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: 3785
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

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

#2 Post by Imperf3kt »

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.

Current project: GGD Mentor

Twitter

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

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

#3 Post by Alex »

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: Ahrefs [Bot], Majestic-12 [Bot]