[SOLVED] How to ovelap the Namebox on the Textbox

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.
Message
Author
User avatar
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

[SOLVED] How to ovelap the Namebox on the Textbox

#1 Post by Colby Alighieri » Fri Feb 24, 2012 12:10 pm

This is what I got----

Image

---From the codes:

Code: Select all

#Message Box and Name Box

    style.say_who_window.background = Frame("ADV NameBox_v2.png", 20, 20) #Background skin
    style.say_who_window.xalign = 0.0
    style.say_who_window.yalign = 1.0
    style.say_who_window.xpos = 113 #For precise placement
    style.say_who_window.ypos = 85 #For precise placement (increasing = down)
    style.say_who_window.left_padding = 15
    style.say_who_window.top_padding = 19
    style.say_who_window.right_padding = 15
    style.say_who_window.bottom_padding = 16
    style.say_who_window.xminimum = 245
    style.say_who_window.yminimum = 36
    style.say_who_window.xfill = False
    
    style.say_label.color="#000000"
    #style.say_label.drop_shadow = [(1, 1)]
    #style.say_label.drop_shadow_color = "#cccccc"
    style.say_label.size = 20
    style.say_label.text_align = 0.5
    style.say_label.xpos = 29
    style.say_label.xalign = 0.5
All it needs to be completed is: I want the name-box to go up front so I could achieve this textbox look:

Image

If there's a code that could put the name-box up in front instead of the back, I'd be IMMENSELY happy :)

If not, might as well think my way around in making this work~
Last edited by Colby Alighieri on Tue Feb 28, 2012 7:00 am, edited 1 time in total.
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

User avatar
PyTom
Ren'Py Creator
Posts: 15554
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Is it possible for the namebox to be on top of the textb

#2 Post by PyTom » Sat Feb 25, 2012 3:32 pm

Go into the say screen, and re-order the two windows so that the who box comes after the what box. They're drawn from back to front, so things in the front have to be after the ones in the back.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Is it possible for the namebox to be on top of the textb

#3 Post by HigurashiKira » Sun Feb 26, 2012 4:44 pm

Forgive me for the thread hijack, but this seemed to have been relevant to my problem. I did as Tom commented, but this happened:
Image

Code: Select all

else:

        # The two window variant.
        vbox:
            style "say_two_window_vbox"

            
                        
            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"
            if who:            
                window:
                    style "say_who_window"

                    text who:
                        id "who" 
I have moved to a new account. Please contact me here from now on. T/Y~

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Is it possible for the namebox to be on top of the textb

#4 Post by nyaatrap » Sun Feb 26, 2012 7:24 pm

xalign and yalign can adjust it. like

Code: Select all

    if who:
        window:
            xalign 0.1
            yalign 0.8
0.1 and 0.8 is sample parameters though.

User avatar
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Is it possible for the namebox to be on top of the textb

#5 Post by Colby Alighieri » Mon Feb 27, 2012 12:11 am

nyaatrap wrote:xalign and yalign can adjust it. like

Code: Select all

    if who:
        window:
            xalign 0.1
            yalign 0.8
0.1 and 0.8 is sample parameters though.
The xalign helped in the positioning, so thanks! But the problem now lies with the yalign. No matter how I changed the values, the namebox doesn't move and stays where it is like a lemon.

Image

This is how I coded it:

Code: Select all


# The two window variant.
        vbox:
            style "say_two_window_vbox"

            if who:            
                window:
                    xalign 0.21
                    yalign 10
                    
                    style "say_who_window"

                    text who:
                        id "who"
                        
            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

I switched back to the default order of the who and what boxes for nyaatrap's solution since combining Pytom's instructions and nyaatrap's created another problem. Forgive my use of words...

Hey there HigurashiKira. Glad we have the same problem :)
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Is it possible for the namebox to be on top of the textb

#6 Post by nyaatrap » Mon Feb 27, 2012 2:02 am

[/deleted wrong code]
Last edited by nyaatrap on Mon Feb 27, 2012 2:58 am, edited 2 times in total.

User avatar
PyTom
Ren'Py Creator
Posts: 15554
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Is it possible for the namebox to be on top of the textb

#7 Post by PyTom » Mon Feb 27, 2012 2:31 am

You probably want to turn that vbox into a fixed, and just position everything using xpos/ypos.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Is it possible for the namebox to be on top of the textb

#8 Post by nyaatrap » Mon Feb 27, 2012 2:56 am

PyTom wrote:You probably want to turn that vbox into a fixed, and just position everything using xpos/ypos.
Ahhh.. I forgot the existence of that vbox *ashamed

User avatar
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Is it possible for the namebox to be on top of the textb

#9 Post by Colby Alighieri » Mon Feb 27, 2012 8:49 am

nyaatrap wrote:
PyTom wrote:You probably want to turn that vbox into a fixed, and just position everything using xpos/ypos.
Ahhh.. I forgot the existence of that vbox *ashamed
Would you mind reposting that code you deleted up there? I didn't have the chance to read it. I might understand something back there because I don't know what's with the "fixed" and the vbox.
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Is it possible for the namebox to be on top of the textb

#10 Post by nyaatrap » Mon Feb 27, 2012 10:36 am

Please forget about that code *embarrassed

Code: Select all

# The two window variant.
        vbox:
            style "say_two_window_vbox"
This vbox was the reason yalign didin't work, because a vbox places following windows vertically.
If you change it to a fixed, you can position windows freely.

Code: Select all

# The two window variant.
        fixed:
            style "say_two_window_vbox"

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Is it possible for the namebox to be on top of the textb

#11 Post by HigurashiKira » Mon Feb 27, 2012 9:12 pm

Again, pardon the hijack, but I've done all the reccomendations on this thread, and still I get this:
Image

Code: Select all

        # The two window variant.
        fixed:
            style "say_two_window_vbox"

            
                        
            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"
           
            if who:            
                window:
                    xalign 0.01
                    yalign 0.15
                    style "say_who_window"

                    text who:
                        id "who" 

Code: Select all

    style.say_who_window.background = Frame("namebox.png", 0, 0)
    style.say_who_window.left_margin = 0
    style.say_who_window.right_margin = 0
    style.say_who_window.left_padding = 0
    style.say_who_window.right_padding = 0
    style.say_who_window.xminimum = 0
    style.say_who_window.ypos = 0
Help?
I have moved to a new account. Please contact me here from now on. T/Y~

User avatar
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Is it possible for the namebox to be on top of the textb

#12 Post by Colby Alighieri » Mon Feb 27, 2012 11:03 pm

nyaatrap wrote:Please forget about that code *embarrassed

Code: Select all

# The two window variant.
        vbox:
            style "say_two_window_vbox"
This vbox was the reason yalign didin't work, because a vbox places following windows vertically.
If you change it to a fixed, you can position windows freely.

Code: Select all

# The two window variant.
        fixed:
            style "say_two_window_vbox"
I followed your instructions but the namebox is still stuck like a lemon.

Image

Here's what I have if it helps.

Code: Select all


 # The two window variant.
        fixed:
            style "say_two_window_vbox"
            
            if who:            
                window:
                    xalign 0.21               
                    yalign 0.29
                    style "say_who_window"

                    text who:
                        id "who"
                        
            window:
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

And here, just in case the problem lies here.

Code: Select all


#Message Box and Name Box
    style.say_who_window.background = Frame("ADV NameBox_v2.png", 20, 20) #Background skin
    style.say_who_window.xalign = 0.0
    style.say_who_window.yalign = 1.0
    style.say_who_window.xpos = 114 #For precise placement
    style.say_who_window.ypos = 89 #For precise placement (increasing = down)
    style.say_who_window.left_padding = 9
    style.say_who_window.top_padding = 9
    style.say_who_window.right_padding = 9
    style.say_who_window.bottom_padding = 9
    style.say_who_window.xminimum = 245
    style.say_who_window.yminimum = 36
    style.say_who_window.xfill = False
    
And HigurashiKira, thread hijacking is welcome for me as long as the problem is related :)
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Is it possible for the namebox to be on top of the textb

#13 Post by nyaatrap » Tue Feb 28, 2012 12:33 am

I should have posted full code >_<
Use ypos instead of yalign. Here is a sample code

Code: Select all

        # The two window variant.
        fixed:
            style "say_two_window_vbox"
            
            window:
                ypos 200
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

            if who:
                window:
                    xpos 100
                    ypos -50
                    style "say_who_window"

                    text who:
                        id "who"
and I got this Image

[edit:]
Also, following codes are no more needed. You can delete them.

Code: Select all

    style.say_who_window.xalign = 0.0
    style.say_who_window.yalign = 1.0
    style.say_who_window.xpos = 114 #For precise placement
    style.say_who_window.ypos = 89 #For precise placement (increasing = down)

HigurashiKira
Miko-Class Veteran
Posts: 832
Joined: Mon Nov 01, 2010 9:10 pm
Contact:

Re: Is it possible for the namebox to be on top of the textb

#14 Post by HigurashiKira » Tue Feb 28, 2012 1:07 am

And that worked (For me at least). Thank you~
I have moved to a new account. Please contact me here from now on. T/Y~

User avatar
Colby Alighieri
Regular
Posts: 75
Joined: Thu Apr 07, 2011 10:39 am
Completed: [KN]Hope In The Morning(Willow's Dream Diary)
Projects: The Last Order: Black Wings
Organization: InsertNameHere Productions
Location: Quezon City, Philippines
Contact:

Re: Is it possible for the namebox to be on top of the textb

#15 Post by Colby Alighieri » Tue Feb 28, 2012 6:57 am

nyaatrap wrote:I should have posted full code >_<
Use ypos instead of yalign. Here is a sample code

Code: Select all

        # The two window variant.
        fixed:
            style "say_two_window_vbox"
            
            window:
                ypos 200
                id "window"

                has vbox:
                    style "say_vbox"

                text what id "what"

            if who:
                window:
                    xpos 100
                    ypos -50
                    style "say_who_window"

                    text who:
                        id "who"
and I got this Image

[edit:]
Also, following codes are no more needed. You can delete them.

Code: Select all

    style.say_who_window.xalign = 0.0
    style.say_who_window.yalign = 1.0
    style.say_who_window.xpos = 114 #For precise placement
    style.say_who_window.ypos = 89 #For precise placement (increasing = down)
8D Ohmigosh! It works now!

Image

Thank you for a thousand suns! Really! Thank you for the patience and coding knowledge you have imparted on us!

THANKS nyaatrap and PyTom FOR THEIR SOLUTIONS. NOW I COULD SAY--

!!! CASE CLOSED !!!
Stagnant? Me too!
Send me a note to my dA Account and I'll see what I can do~!

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Woetoo