Page 1 of 1

[RESOLVED] Centered text in screen

Posted: Sun Nov 22, 2015 2:09 pm
by Camille
I'm trying to make a calendar screen and I want all the text to be centered like so:

Image

But when I try turning that mock-up into screen language, I end up with this:

Image

As you can see, the text doesn't center properly for each month/day/day of the week block. It's particularly noticeable on the first and last days. My code currently looks like this:

Code: Select all

    text "25" font "type/JuraDemiBold.ttf" size 100 color "#48ddb4" xalign 0.18 yalign 0.4 text_align 0.5 min_width 137 justify True
    text "MAY" font "type/Jura-Medium.otf" size 58 color "#48ddb4" xalign 0.18 yalign 0.5 text_align 0.5 min_width 137 justify True
    text "TUESDAY" font "type/JuraBook.ttf" size 25 color "#48ddb4" xalign 0.18 yalign 0.6 text_align 0.5 min_width 137 justify True

    text "26" font "type/JuraDemiBold.ttf" size 100 color "#48ddb4" xalign 0.35 yalign 0.4 text_align 0.5 min_width 137 justify True
    text "MAY" font "type/Jura-Medium.otf" size 58 color "#48ddb4" xalign 0.35 yalign 0.5 text_align 0.5 min_width 137 justify True
    text "WEDNESDAY" font "type/JuraBook.ttf" size 25 color "#48ddb4" xalign 0.35 yalign 0.6 text_align 0.5 min_width 137 justify True

    text "27" font "type/JuraDemiBold.ttf" size 100 color "#48ddb4" xalign 0.51 yalign 0.4 text_align 0.5 min_width 137 justify True
    text "MAY" font "type/Jura-Medium.otf" size 58 color "#48ddb4" xalign 0.51 yalign 0.5 text_align 0.5 min_width 137 justify True
    text "THURSDAY" font "type/JuraBook.ttf" size 25 color "#48ddb4" xalign 0.51 yalign 0.6 text_align 0.5 min_width 137 justify True

    text "28" font "type/JuraDemiBold.ttf" size 100 color "#48ddb4" xalign 0.68 yalign 0.4 text_align 0.5 min_width 137 justify True
    text "MAY" font "type/Jura-Medium.otf" size 58 color "#48ddb4" xalign 0.68 yalign 0.5 text_align 0.5 min_width 137 justify True
    text "FRIDAY" font "type/JuraBook.ttf" size 25 color "#48ddb4" xalign 0.68 yalign 0.6 text_align 0.5 min_width 137 justify True

    text "29" font "type/JuraDemiBold.ttf" size 100 color "#48ddb4" xalign 0.85 yalign 0.4 text_align 0.5 min_width 137 justify True
    text "MAY" font "type/Jura-Medium.otf" size 58 color "#48ddb4" xalign 0.85 yalign 0.5 text_align 0.5 min_width 137 justify True
    text "SATURDAY" font "type/JuraBook.ttf" size 25 color "#48ddb4" xalign 0.85 yalign 0.6 text_align 0.5 min_width 137 justify True
I set the min_width to 137 because that's the width of the word WEDNESDAY which, as far as I can tell, is the widest that these blocks are ever going to be. (the months are abbreviated) Any help would be greatly appreciated.

Re: Centered text in screen

Posted: Sun Nov 22, 2015 2:46 pm
by PyTom
Can you grab a nightly? There's a bug fixed there that might have been causing this problem.

Re: Centered text in screen

Posted: Sun Nov 22, 2015 3:03 pm
by Camille
Oh yay, it works properly after updating! That's a huge relief, thanks.