[SOLVED] Rotated text keeps moving!

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
pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

[SOLVED] Rotated text keeps moving!

#1 Post by pfranzen » Tue Sep 20, 2022 6:26 pm

...Maybe that's not a GREAT subject line.

Anyway! I'm trying to add text to a screen that 1) is rotated -9 degrees, and 2) includes a variable that users can modify.

My code looks like this:

Code: Select all

    transform:
        rotate -9
        text "{size=-11}{color=04297a}{font=fonts/LinLibertine_R.ttf}1st Bank of [persistent.town] - {/size}{size=+1}10108{/size}{/font}{/color}"
        pos (1485, 925)
        anchor (0.5, 0.5)
When the user types in a shorter name (say, LA), it looks like this (we're looking at the text on the pen):

Image

When the user types in a longer name (say, New York City):

Image

Notice how the x-position of the text changes from image to image. Ideally, it would stay in one consistent, predictable place.

I added the anchor code because I read in a different forum thread that that would fix it, but that doesn't seem to have been the case for me. Any ideas?
Last edited by pfranzen on Tue Sep 20, 2022 7:17 pm, edited 1 time in total.

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

Re: Rotated text keeps moving!

#2 Post by Ocelot » Tue Sep 20, 2022 7:07 pm

I do not see the problem. The text is rotated around anchor point. I checked and it seems to be in the same position in both screenshots.

Image
< < insert Rick Cook quote here > >

pfranzen
Regular
Posts: 42
Joined: Fri Apr 01, 2016 2:39 pm
Completed: Cat President 1+2, Internet Court, Too Many Santas, The Awkward Steve Duology, The Pizza Delivery Boy Who Saved the World, Francy Droo & Friends
Organization: Oh, a Rock! Studios
itch: oharock
Contact:

Re: Rotated text keeps moving!

#3 Post by pfranzen » Tue Sep 20, 2022 7:16 pm

Ah, so that's what the .5 means! It's essentially center-aligning the text.

So, I changed the .5 to 0, and now it's doing what I want it to! Thanks!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot]