Setting maximum number of lines for renpy.input

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
EveningDove
Newbie
Posts: 5
Joined: Thu Jun 07, 2018 2:20 pm
Contact:

Setting maximum number of lines for renpy.input

#1 Post by EveningDove » Fri Jun 29, 2018 5:06 pm

Hello! I'm trying to make a custom input field that limits the number of lines the user can enter.

Basically, I'm trying to give the player an in-game notepad where they can write things down, but they only have enough space to write a handful of lines. (In other words, I want it to work similarly to the renpy.input properties "pixel_width" and "length", but vertically.)

For completeness/context, here's my code:

Code: Select all

screen CustomField_input(x, y, pixelWidth, pixelHeight, defaultText=""):
    window:
        style "CustomField_TypingIn"
        frame:
            background None
            xpos x ypos y
            xsize pixelWidth ysize pixelHeight

            input:
                id "input"
                layout "greedy"
                xpos 0
                ypos 0
                ymaximum pixelHeight #This dosnt seem to do anything
                size 20
                font "FSEX300.ttf"
                exclude "[]\\"
                default defaultText
    use quick_menu
Any help would be greatly appreciated!!

Post Reply

Who is online

Users browsing this forum: No registered users