Page 1 of 1

Rotate Namebox

Posted: Fri Apr 28, 2017 2:36 pm
by Rils
Is it possible to rotate the gui.name and gui.namebox?

Re: Rotate Namebox

Posted: Fri Apr 28, 2017 3:44 pm
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:

Re: Rotate Namebox

Posted: Fri Apr 28, 2017 5:39 pm
by Rils
Hmm, I didn't mean to make it vertical, I meant being able to put it at a 15 Degree angle.

Re: Rotate Namebox

Posted: Fri Apr 28, 2017 7:24 pm
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.

Re: Rotate Namebox

Posted: Fri Apr 28, 2017 9:38 pm
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.

Re: Rotate Namebox

Posted: Fri Apr 28, 2017 10:55 pm
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"

    . . .

Re: Rotate Namebox

Posted: Sat Apr 29, 2017 2:25 am
by Rils
Woo, that works, after fiddling with positioning and stuff it'll work great, thanks!

Re: Rotate Namebox

Posted: Fri May 19, 2017 10:08 pm
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

Re: Rotate Namebox

Posted: Sat May 20, 2017 12:56 am
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.

Re: Rotate Namebox

Posted: Sat May 20, 2017 2:21 am
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:

Re: Rotate Namebox

Posted: Sat May 20, 2017 2:28 am
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"

Re: Rotate Namebox

Posted: Sat May 20, 2017 2:30 am
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!