Using Transform() on the "namebox"?

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
User avatar
tim640
Regular
Posts: 47
Joined: Wed May 23, 2018 4:47 pm
Contact:

Using Transform() on the "namebox"?

#1 Post by tim640 »

Hello again!
So the subject name is pretty self-explaining, i think. Basically, i want to rotate the character name to, let's say, 25 degrees. Is that even possible?.. As from what i read, you need to kinda "turn" text object into "image" for Renpy to transform it, but how can one do so with an object like "namebox"? Since it has an id and is defined by character name. I tried

Code: Select all

    style_prefix "say"
    window:
        id "window"

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who"
                $ Transform('namebox', rotate=25)



        text what id "what"



        add SideImage() xalign 0.0 yalign 1.0


but of course it's not that simple because it doesn't work haha. Will be grateful for any help and ideas!!

Rayne
Newbie
Posts: 7
Joined: Mon May 28, 2018 9:46 pm
Contact:

Re: Using Transform() on the "namebox"?

#2 Post by Rayne »

Add this before "say" screen, or anywhere else really:

Code: Select all

transform NameRotation:
    rotate 25
And then you can do:

Code: Select all

text who id "who" at NameRotation

User avatar
tim640
Regular
Posts: 47
Joined: Wed May 23, 2018 4:47 pm
Contact:

Re: Using Transform() on the "namebox"?

#3 Post by tim640 »

It's like magic!! So i've got the overall principal of it wrong, it works kinda like layers, then?
Thank you so much for a quick response!

Rayne
Newbie
Posts: 7
Joined: Mon May 28, 2018 9:46 pm
Contact:

Re: Using Transform() on the "namebox"?

#4 Post by Rayne »

I guess it works just like any other Displayable.
I played around with transforming images earlier and figured it'll work the same way for text.
Here's more on that: https://www.renpy.org/doc/html/displaya ... splayables

You're welcome! :D

Post Reply

Who is online

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