Page 1 of 1

Character Limit for Player Input Save Game Name [SOLVED]

Posted: Wed Mar 13, 2019 5:23 pm
by sheetcakeghost
So I'm using the following code (ty ocelot) to let the player name their own save files.

Code: Select all

screen file_slots(title):
    default page_name_value = FilePageNameInputValue(pattern=_("Page {}"), auto=_("Automatic saves"), quick=_("Quick saves"))
    use game_menu(title):
        fixed:
            input:
                value VariableInputValue('save_name')
It works like a dream except if you put in more than 36 characters it begins to stretch the GUI. I want to add a character limit for the input prompt, but it's a bit trickier to use with this code than it is with just character names. [I can't just use ('save_name', length=36) for example.]

I've attempted some work arounds like making save button to call up a screen that just asks the player to name the save, but I don't like how that interrupts the smoothness of just clicking the thumbnail and making a save happen.

Would anyone else have some ideas for me to try? I'd really appreciate it.

Re: Character Limit for Player Input Save Game Name

Posted: Wed Mar 13, 2019 9:11 pm
by philat

Code: Select all

input:
    value VariableInputValue('save_name')
    pixel_width 200 # or whatever the appropriate width is
https://www.renpy.org/doc/html/screens.html#input

Re: Character Limit for Player Input Save Game Name

Posted: Thu Mar 14, 2019 8:48 pm
by sheetcakeghost
Lovely! Does just what I needed.