Can You Make The Namebox Below 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.
Post Reply
Message
Author
User avatar
tiya_nofurita
Miko-Class Veteran
Posts: 669
Joined: Fri Jun 22, 2012 7:23 pm
Completed: ALLBLACK Phase 1, Heart's Blight, Last Rx., EDDA Cafe, Kohana, Half Moon
Projects: ALLBLACK Phase 2
Organization: VN Project Indonesia
Deviantart: SECONDARY-TARGET
itch: NSAID
Location: I can be everywhere
Discord: 3,4-Methylendioxymethamphetamine#4886
Contact:

Can You Make The Namebox Below the Textbox?

#1 Post by tiya_nofurita »

Just asking, is it possible for Ren'Py to place the namebox below the textbox, just like this game?
I've been trying with style.say_who_window whatever it is but to no avail.
67865.jpg
Webtoon

"For what reason I live?"
Image

---
Completed project:


"What will you see when you are dead?"

Image

MY VISUAL NOVEL

User avatar
PyTom
Ren'Py Creator
Posts: 16096
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: Can You Make The Namebox Below the Textbox?

#2 Post by PyTom »

The way to do this is to edit screens.rpy, and change the order of things in the say screen.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
tiya_nofurita
Miko-Class Veteran
Posts: 669
Joined: Fri Jun 22, 2012 7:23 pm
Completed: ALLBLACK Phase 1, Heart's Blight, Last Rx., EDDA Cafe, Kohana, Half Moon
Projects: ALLBLACK Phase 2
Organization: VN Project Indonesia
Deviantart: SECONDARY-TARGET
itch: NSAID
Location: I can be everywhere
Discord: 3,4-Methylendioxymethamphetamine#4886
Contact:

Re: Can You Make The Namebox Below the Textbox?

#3 Post by tiya_nofurita »

Hm, it works, but how can I "centered" the position of namebox now?
This doesn't work as expected. I want it to be "centered" on the below screen, no matter how long the "say" sentence is.

Code: Select all

    if not two_window:

        # The one window variant.        
        window:
            id "window"

            has vbox:
                style "say_vbox"
                
            text what id "what"
            
            if who:
                vbox xalign 0.5 ypos 0.9:
                    text who id "who"
screenshot0001.png
Last edited by tiya_nofurita on Thu May 15, 2014 7:41 pm, edited 1 time in total.
Webtoon

"For what reason I live?"
Image

---
Completed project:


"What will you see when you are dead?"

Image

MY VISUAL NOVEL

User avatar
Donmai
Eileen-Class Veteran
Posts: 1960
Joined: Sun Jun 10, 2012 1:45 am
Completed: Toire No Hanako, Li'l Red [NaNoRenO 2013], The One in LOVE [NaNoRenO 2014], Running Blade [NaNoRenO 2016], The Other Question, To The Girl With Sunflowers
Projects: Slumberland
Location: Brazil
Contact:

Re: Can You Make The Namebox Below the Textbox?

#4 Post by Donmai »

try something like

Code: Select all

style say_who_window:
    xalign 0.5
Not tested.
Image
No, sorry! You must be mistaking me for someone else.
TOIRE NO HANAKO (A Story About Fear)

User avatar
tiya_nofurita
Miko-Class Veteran
Posts: 669
Joined: Fri Jun 22, 2012 7:23 pm
Completed: ALLBLACK Phase 1, Heart's Blight, Last Rx., EDDA Cafe, Kohana, Half Moon
Projects: ALLBLACK Phase 2
Organization: VN Project Indonesia
Deviantart: SECONDARY-TARGET
itch: NSAID
Location: I can be everywhere
Discord: 3,4-Methylendioxymethamphetamine#4886
Contact:

Re: Can You Make The Namebox Below the Textbox?

#5 Post by tiya_nofurita »

Tried it, but the frame looks weird. It doesn't "stretch" as long as the textbox goes.
screenshot0003.png
Webtoon

"For what reason I live?"
Image

---
Completed project:


"What will you see when you are dead?"

Image

MY VISUAL NOVEL

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Can You Make The Namebox Below the Textbox?

#6 Post by Asceai »

Code: Select all

style say_who_window xfill True
style say_label xalign 0.5

User avatar
tiya_nofurita
Miko-Class Veteran
Posts: 669
Joined: Fri Jun 22, 2012 7:23 pm
Completed: ALLBLACK Phase 1, Heart's Blight, Last Rx., EDDA Cafe, Kohana, Half Moon
Projects: ALLBLACK Phase 2
Organization: VN Project Indonesia
Deviantart: SECONDARY-TARGET
itch: NSAID
Location: I can be everywhere
Discord: 3,4-Methylendioxymethamphetamine#4886
Contact:

Re: Can You Make The Namebox Below the Textbox?

#7 Post by tiya_nofurita »

Asceai wrote:

Code: Select all

style say_who_window xfill True
style say_label xalign 0.5
It works! Although now the "height" of the textbox between "narrated" and "say" sentences looks drastically different because of two window variant....I really have no idea how to implement this with one window variant, so it'd be the same height no matter "narrated" or "say" sentences.

Nevertheless thank you all for your help :D
screenshot0004.png
screenshot0005.png
Webtoon

"For what reason I live?"
Image

---
Completed project:


"What will you see when you are dead?"

Image

MY VISUAL NOVEL

Asceai
Eileen-Class Veteran
Posts: 1258
Joined: Fri Sep 21, 2007 7:13 am
Projects: a battle engine
Contact:

Re: Can You Make The Namebox Below the Textbox?

#8 Post by Asceai »

I don't know of a good way to do that with styles. What I'd do is move the 'if who:' check:
  • Remove it and de-indent everything inside it so it's at the same level of indentation as 'if who:' before.
  • Add 'if who:' in the place where the 'text who' code is, then indent that, so the who window appears even though the text doesn't.
  • Then add an 'else:' statement to the 'if who:' with something like text "" so the window has a child of the right height.

User avatar
15nick
Regular
Posts: 33
Joined: Thu Oct 17, 2013 2:46 am
Contact:

Re: Can You Make The Namebox Below the Textbox?

#9 Post by 15nick »

You could do custom textboxes for the characters that have their names in the image so you wouldn't need a namebox.

Code: Select all

define tito = Character("", window_background="textbox_tito.png", BLAH BLAH OTHER PROPERTIES)
I copied this from an old version project so the coding might have changed since then, but the general idea is the same.

User avatar
tiya_nofurita
Miko-Class Veteran
Posts: 669
Joined: Fri Jun 22, 2012 7:23 pm
Completed: ALLBLACK Phase 1, Heart's Blight, Last Rx., EDDA Cafe, Kohana, Half Moon
Projects: ALLBLACK Phase 2
Organization: VN Project Indonesia
Deviantart: SECONDARY-TARGET
itch: NSAID
Location: I can be everywhere
Discord: 3,4-Methylendioxymethamphetamine#4886
Contact:

Re: Can You Make The Namebox Below the Textbox?

#10 Post by tiya_nofurita »

15nick wrote:You could do custom textboxes for the characters that have their names in the image so you wouldn't need a namebox.

Code: Select all

define tito = Character("", window_background="textbox_tito.png", BLAH BLAH OTHER PROPERTIES)
I copied this from an old version project so the coding might have changed since then, but the general idea is the same.
Ah! That's very convenient and easy method lol never thought of that :p. Less flexible indeed and memory-consuming.
I'll try it soon
Webtoon

"For what reason I live?"
Image

---
Completed project:


"What will you see when you are dead?"

Image

MY VISUAL NOVEL

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot], Majestic-12 [Bot]