Vbox Style Properties-- how to control min. height? (solved)

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
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Vbox Style Properties-- how to control min. height? (solved)

#1 Post by noeinan » Sat Nov 08, 2014 8:05 am

I have been using the MultiCharacter code here: http://vbkaisetsu.sky-air.net/wordpress ... %E3%82%8B/ in order to create a section of my game with two textboxes at once. (More also in this thread: http://lemmasoft.renai.us/forums/viewto ... =8&t=26505)

I have managed to make the two text boxes vertical (they are horizontal by default), but when they are vertical they don't stay a consistent size. If the top textbox has fewer lines, the bottom textbox jumps as well. (There is a set "spacing" between the top and bottom, but I would instead like to fix the top and bottom in place.) I have been playing around with the window style and haven't figured out how to fix this yet. :/

In the screens.rpy file, I changed hbox to vbox to get the desired effect:

Code: Select all

##############################################################################
# Multi
#
# Screen used for multi-mode dialogue.

screen multi:

    window:
        style "multi_window"

        has vbox:
            style "multi_vbox"

        # Display dialogue.
        for who, what, who_id, what_id, window_id in dialogue:
            window:
                id window_id

                has vbox:
                    spacing 10

                if who is not None:
                    text who id who_id

                text what id what_id
Now, in the 00multi_mode.rpy file, I have been trying to make changes with the multi_window and multi_vbox styles. So far, I've managed to get a textbox background for the boxes and control how high up on the screen the two text boxes display.

Code: Select all

##############################################################################
# The implementation of Multi mode lives below this line.

init -1500 python:

    # Styles that are used by multi mode.
    style.create('multi_window', 'say_window', 'the window containing multi-mode dialogue')
    style.create('multi_vbox', 'vbox', 'the vbox containing each box of multi-mode dialogue')
    style.create('multi_label', 'say_label', 'an multi-mode character\'s name')
    style.create('multi_dialogue_dual', 'say_dialogue', 'dual-mode character dialogue')
    style.create('multi_entry', 'default', 'a window containing each line of multi-mode dialogue')

    style.multi_window.yminimum = 400
    style.multi_window.xminimum = int(config.screen_width / 2) - 5
    style.multi_window.background = "gui/textbox.png"
    
    style.multi_vbox.box_spacing = 50

    # Set up dual mode styles.
    style.multi_dialogue_dual.minwidth = int(config.screen_width / 2) - 5
    style.multi_dialogue_dual.xmaximum = int(config.screen_width / 2) - 5
So then, I am guessing what I would need is some ability to control the minimum size of each vbox. For the text to fit inside the background images I've made, I'll need to standardize them. However, according to this documentation: http://www.renpy.org/wiki/renpy/doc/ref ... Properties there is no yminimum property for box styles. (And when I tried to use it like that, it didn't work...)

Does anyone have any advice for how I would accomplish this?
Attachments
MultiCharacter001.png
MultiCharacter002.png
Last edited by noeinan on Sun Nov 09, 2014 2:11 pm, edited 1 time in total.
Image

Image
Image

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: Vbox Style Properties-- how to control min. height?

#2 Post by noeinan » Sat Nov 08, 2014 8:42 am

Or, I guess I could just try to change the code in screen.rpy to have two sections each with their own ypos... The way it is currently set up, it takes variables from elsewhere in the code though, and you could change this code to add more textboxes (for example, you could have three or four on screen.) I'll see if I can figure out a way to do this without breaking it. :/
Image

Image
Image

User avatar
meiri
Regular
Posts: 177
Joined: Wed Jun 25, 2014 6:21 pm
Projects: Tutor Tabitha, Movement
Organization: Blue Bottlecap Games
Location: East Coast, US
Contact:

Re: Vbox Style Properties-- how to control min. height?

#3 Post by meiri » Sat Nov 08, 2014 2:02 pm

Well, I'm certainly no code expert, and there's a possibility you've already tried this, but I would attempt changing

style.multi_window.yminimum = 400

to

style.multi_window.ymaximum = 400

Or if that doesn't work right, keeping yminimum and adding in the ymaximum?

I would test this myself, but I can't exactly replicate the image for the textbox.


Edit: Scratch out what's above-- I don't think it works, but I'm still taking a look at the code.
What's in a loop? A loop iterated in any other way would output as sweet.
--
Have a look at my GxG kinetic novel, Movement, if you have the chance?

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: Vbox Style Properties-- how to control min. height?

#4 Post by noeinan » Sun Nov 09, 2014 8:12 am

Yeah, I was trying yminimum and ymaximum, but it didn't seem to make a difference. Right now I'm thinking I'll have to somehow permanently set there to be two windows with permanent positions. (As opposed to now, when you can add more if you want, and they position themselves based on the spacing between however many there are.

Haven't quite figured out how to make sure all the correct data goes where it's supposed to be, but if I can get it working I'll post it here. I don't understand most of this code either-- I just play around with things to see if I can find something that works, and look at documentation for ideas, haha. Sort of a scientific approach to coding rather than an actual programming approach.

If anyone wants to take a look, I've attached the whole project if anyone wants to take a look.
Attachments
MultiCharacter.rar
(390.38 KiB) Downloaded 39 times
Image

Image
Image

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: Vbox Style Properties-- how to control min. height?

#5 Post by akemicchi » Sun Nov 09, 2014 8:46 am

I got it to work using:

Code: Select all

    style.multi_entry.ymaximum = 100
    style.multi_entry.yfill = True

User avatar
noeinan
Eileen-Class Veteran
Posts: 1153
Joined: Sun Apr 04, 2010 10:10 pm
Projects: Ren'Py QuickStart, Crimson Rue
Organization: Statistically Unlikely Games
Deviantart: noeinan
Github: noeinan
Location: Washington State, USA
Contact:

Re: Vbox Style Properties-- how to control min. height?

#6 Post by noeinan » Sun Nov 09, 2014 2:11 pm

Thanks! That's a lot easier than what I was trying to do, haha.
Image

Image
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]