Page 1 of 1

How to move text inside Textbutton?

Posted: Sun Aug 20, 2017 3:55 pm
by Nero
So lets say I got simple Textbutton that does nothing text inside it by default will be in center question is how do i move it around the textbutton area? Is that even possible? Like if i do xalign whole button will be moved obviously how to do it just for the text inside the textbutton?

Code: Select all

init python:
    #This controls minimum button length
    style.companionstats = Style(style.frame)
    style.companionstats_button.xmaximum = 115
    style.companionstats_button.xminimum = 115

Code: Select all

screen test:
    frame:
        style_group "companionstats"
        xalign 0.500
        yalign 0.500
        vbox:
            textbutton "BUTTON"

Re: How to move text inside Textbutton?

Posted: Sun Aug 20, 2017 5:17 pm
by Remix
textbutton "Text" ... text_{any text style property} value

Text style properties

textbutton "Text" ... text_text_align 0.1
should move it left

or text_style style.some_var_you_set_in_gui

Note: Untested, just surmised from TextButton class. Also, that is new gui, so might not work on older versions

Re: How to move text inside Textbutton?

Posted: Mon Aug 21, 2017 2:58 am
by Nero
Tried it and it doesn't work :/ . In documentation it was really confusing for me to have property named "text_-" this "-" is clearly not needed there. This one looks like a Ren'Py bug by documentation "text_text_align 0.1" should be working

Re: How to move text inside Textbutton?

Posted: Mon Aug 21, 2017 3:18 am
by shin.e.d
How about this?

Code: Select all

style x_button is frame:
    xsize 315

style x_button_text:
    xalign 0.0 yalign 0.5

screen x:
    frame:
        xalign 0.5 yalign 0.5
        vbox:
            style_prefix "x"
            textbutton "button" action NullAction()
            

Re: How to move text inside Textbutton?

Posted: Mon Aug 21, 2017 3:45 am
by Nero
Ah finally it works thank you!

Still not sure why this what Remix said wont work even it is explained in documentation and by logic it should be working .