Page 1 of 1

[solved] ui.text align part of text at 0.0 and part at 1.0?

Posted: Tue Nov 22, 2011 5:53 pm
by netravelr
No source code as it's more of a speculative question, but I was wondering if anyone knew of a way to have text similar to this:


Beginning of Text End of Text|

where | is the right aligned part of the message box. I tried doing something like

Code: Select all

ui.text(Beginning of Text{xalign=1.0}End of Text|{/xalign})
but of course that doesn't work.

I was thinking of a hacky way to do it by creating another line with the position in the previous line's Y pos but I don't know how to access that variable as well. Any ideas?

Re: ui.text align part of text at 0.0 and part at 1.0?

Posted: Wed Nov 23, 2011 12:50 am
by PyTom
There isn't a way to do this with a single Text. You could do:

Code: Select all

hbox:
    xfill True
    text "Foo"
    text "Bar" xalign 1.0

Re: ui.text align part of text at 0.0 and part at 1.0?

Posted: Wed Nov 23, 2011 1:08 am
by netravelr
That's exactly what I was looking for. Thanks so much!

Re: [solved] ui.text align part of text at 0.0 and part at 1

Posted: Sat Apr 26, 2014 12:20 pm
by Kazhuto
where i should put this code in ? option ? screen ? script ?

Re: [solved] ui.text align part of text at 0.0 and part at 1

Posted: Sat Apr 26, 2014 2:45 pm
by Alex
It doesn't metter in which file you'll put it. And I suspect that this is a part of a screen, so try

Code: Select all

screen my_scr:
    hbox:
        yalign 0.1
        xfill True
        text "Foo"
        text "Bar" xalign 1.0

label start:
    show screen my_scr
    "?"
http://www.renpy.org/wiki/renpy/FAQ#How ... e_files.3F