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 » Fri Apr 28, 2017 2:36 pm

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

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

Re: Rotate Namebox

#2 Post by renpic » Fri Apr 28, 2017 3:44 pm

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
screenshot1.png
First example.
screenshot1.png (11.11 KiB) Viewed 334 times
screenshot2.png
Second example.
screenshot2.png (12.41 KiB) Viewed 334 times

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

Re: Rotate Namebox

#3 Post by Rils » Fri Apr 28, 2017 5:39 pm

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

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

Re: Rotate Namebox

#4 Post by renpic » Fri Apr 28, 2017 7:24 pm

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
Miko-Class Veteran
Posts: 866
Joined: Mon Dec 14, 2015 5:05 am
Location: Your monitor
Contact:

Re: Rotate Namebox

#5 Post by Imperf3kt » Fri Apr 28, 2017 9:38 pm

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.
Image

Warning: May contain trace amounts of gratuitous plot.

User avatar
Divona
Miko-Class Veteran
Posts: 604
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 » Fri Apr 28, 2017 10:55 pm

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 » Sat Apr 29, 2017 2:25 am

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

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

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

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 234 times

User avatar
Divona
Miko-Class Veteran
Posts: 604
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 » Sat May 20, 2017 2:28 am

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

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: Xaiyeon