Change Alignment of show text

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
suspiciousmagic
Newbie
Posts: 6
Joined: Sat May 27, 2023 3:57 pm
Contact:

Change Alignment of show text

#1 Post by suspiciousmagic »

Whenever you display multiple lines of text with \n, it automatically centers it, but I'm trying to make it left aligned. xalign just changes its location on the screen, and text_align causes an error. I would just use photoshop to make the text but it's a value given as an input so I have to do it this way.
Untitled-1.png
Untitled-1.png (5.14 KiB) Viewed 3877 times

Code: Select all

scene something
show text "This\nis\nan\nexample":
	xpos .52 ypos .16 xanchor .5 yanchor 1

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2498
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: Change Alignment of show text

#2 Post by Ocelot »

< < insert Rick Cook quote here > >

suspiciousmagic
Newbie
Posts: 6
Joined: Sat May 27, 2023 3:57 pm
Contact:

Re: Change Alignment of show text

#3 Post by suspiciousmagic »

Whenever I type textalign, the word doesn't change color like most built in variables do, nor does anything happen ingame
Making it a style and using text_align doesn't error, but nothing happens either

Code: Select all

style leftalign:
    textalign 0.0
    #or:
    text_align 0.0
    

Code: Select all

scene something
show text "{=leftalign}this\nis\nan\nexample{=leftalign}"

suspiciousmagic
Newbie
Posts: 6
Joined: Sat May 27, 2023 3:57 pm
Contact:

Re: Change Alignment of show text

#4 Post by suspiciousmagic »

I couldn't find a solution but I made it look fine without the alignment, so it's fine

User avatar
m_from_space
Eileen-Class Veteran
Posts: 1238
Joined: Sun Feb 21, 2021 3:36 am
Contact:

Re: Change Alignment of show text

#5 Post by m_from_space »

suspiciousmagic wrote: Sat Nov 18, 2023 9:45 pm I couldn't find a solution but I made it look fine without the alignment, so it's fine
It works if you do it like this:

Code: Select all

screen myscreen(what):
    text what:
        align (0.5, 0.5)
        textalign 0.0

label start:
    show screen myscreen("this\nis\nan\nexample")
    "Fin.."
Whenever I type textalign, the word doesn't change color like most built in variables do, ...
That just means that the editor doesn't recognize it as a keyword of the programming language. But it is.

Post Reply

Who is online

Users browsing this forum: halnye