Rotate 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
Rils
Newbie
Posts: 9
Joined: Sat Oct 22, 2016 11:20 pm
Contact:

Rotate Namebox

#1 Post by Rils »

Is it possible to rotate the gui.name and gui.namebox?

renpic
Newbie
Posts: 19
Joined: Sat Apr 08, 2017 1:07 pm
Location: Europe
Contact:

Re: Rotate Namebox

#2 Post by renpic »

Rils wrote:Is it possible to rotate the gui.name and gui.namebox?
In screens.rpy, find the "screen say" definition. There is a line that says:

Code: Select all

text who id "who"
Change it to:

Code: Select all

text who id "who" vertical True
Now, when I tried it, the name was overlapping a bit with the text message.

A partial solution was to add a hbox for the two windows. Hence my code became:

Code: Select all

screen say(who, what):
    style_prefix "say"
    window:
        id "window"
        hbox:
            if who is not None:
                window:
                    style "namebox"
                    text who id "who" vertical True
            text what id "what"
Now the name is a bit too far from the text, for my liking, but it is a start! :smile:
Attachments
First example.
First example.
screenshot1.png (11.11 KiB) Viewed 2337 times
Second example.
Second example.
screenshot2.png (12.41 KiB) Viewed 2337 times

Rils
Newbie
Posts: 9
Joined: Sat Oct 22, 2016 11:20 pm
Contact:

Re: Rotate Namebox

#3 Post by Rils »

Hmm, I didn't mean to make it vertical, I meant being able to put it at a 15 Degree angle.

renpic
Newbie
Posts: 19
Joined: Sat Apr 08, 2017 1:07 pm
Location: Europe
Contact:

Re: Rotate Namebox

#4 Post by renpic »

Rils wrote:Hmm, I didn't mean to make it vertical, I meant being able to put it at a 15 Degree angle.
I am not sure you can do it with text :O

:idea: Perhaps you can add the rotated name to the side image, and just hide the namebox.

User avatar
Imperf3kt
Lemma-Class Veteran
Posts: 3791
Joined: Mon Dec 14, 2015 5:05 am
itch: Imperf3kt
Location: Your monitor
Contact:

Re: Rotate Namebox

#5 Post by Imperf3kt »

Use ATL
Include "text" instead of "image"

Then don't use a namebox, instead make a function so every time a character shows, your ATL also shows (I Don't know how to do this) or call it every time manually.
That or put it physically in the side image.

These are my suggestions, they may not be optimal, so use them with caution.
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.

Current project: GGD Mentor

Twitter

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Rotate Namebox

#6 Post by Divona »

Make an ATL code to rotate object -15 degree. Add it to namebox window in "screen say()" under "screens.rpy".

Code: Select all

transform namebox_rotate():
    rotate -15

screen say(who, what):

    . . .

    if who is not None:

        window at namebox_rotate:
        style "namebox"
        text who id "who"

    text what id "what"

    . . .
Completed:
Image

Rils
Newbie
Posts: 9
Joined: Sat Oct 22, 2016 11:20 pm
Contact:

Re: Rotate Namebox

#7 Post by Rils »

Woo, that works, after fiddling with positioning and stuff it'll work great, thanks!

Groundbird
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 6:17 am
Tumblr: dallasgenoard
Skype: touhruadachi
Contact:

Re: Rotate Namebox

#8 Post by Groundbird »

Divona wrote:Make an ATL code to rotate object -15 degree. Add it to namebox window in "screen say()" under "screens.rpy".

Code: Select all

transform namebox_rotate():
    rotate -15

screen say(who, what):

    . . .

    if who is not None:

        window at namebox_rotate:
        style "namebox"
        text who id "who"

    text what id "what"

    . . .
Sorry, this is an old thread and I should probably just use mine, but.
How do I use this code? I've been Googling for over an hour, trying various things, and I can't figure out how ATLs work at all ( extreme noob to all of this ). I've pasted the rotate code in, and now I'm not sure where to go from there. Could you explain a bit more ... ?

I'm more or less trying to rotate the name to fit on the image!
http://prntscr.com/f9wvav

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Rotate Namebox

#9 Post by Divona »

If you could drop the code you have here, I could help point out what else you need to do. It's pretty much just having a transform code somewhere and make an edit to "screen say" in "screens.rpy" file.
Completed:
Image

Groundbird
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 6:17 am
Tumblr: dallasgenoard
Skype: touhruadachi
Contact:

Re: Rotate Namebox

#10 Post by Groundbird »

Divona wrote:If you could drop the code you have here, I could help point out what else you need to do. It's pretty much just having a transform code somewhere and make an edit to "screen say" in "screens.rpy" file.
Thank you for all your help.

So I thought it might have been a problem with my customization initially, and I've been messing around with various things on a default code instead.
I more or less added the transform to the original screens rpy file. Is there something that I should place somewhere else as well? I feel like I must be missing adding a certain tag to other option rpy files, or to my script, or something like that, because I can't for the life of me think of what else it could be. :oops:
Attachments
test code.png
test code.png (9.77 KiB) Viewed 2237 times

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Rotate Namebox

#11 Post by Divona »

You have to assign transform to "who" window, and that's it. You can continue to add more style and transform properties to "namebox_rotate()" to adjust the position and other things to your liking.

Code: Select all

transform namebox_rotate():
    rotate -15

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window at namebox_rotate:
                style "namebox"
                text who id "who"

        text what id "what"
Completed:
Image

Groundbird
Newbie
Posts: 10
Joined: Fri Jul 03, 2015 6:17 am
Tumblr: dallasgenoard
Skype: touhruadachi
Contact:

Re: Rotate Namebox

#12 Post by Groundbird »

Divona wrote:You have to assign transform to "who" window, and that's it. You can continue to add more style and transform properties to "namebox_rotate()" to adjust the position and other things to your liking.

Code: Select all

transform namebox_rotate():
    rotate -15

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window at namebox_rotate:
                style "namebox"
                text who id "who"

        text what id "what"
Oh, I see! D'oh. What a simple fix that I completely overlooked, haha. The grief of the hours I spent puzzling over ATLs and such. At least I learned some things that may be useful in the future. Thanks so much again!

Post Reply

Who is online

Users browsing this forum: No registered users