Character Limit for Player Input Save Game Name [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
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Character Limit for Player Input Save Game Name [SOLVED]

#1 Post 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.
Last edited by sheetcakeghost on Thu Mar 14, 2019 8:48 pm, edited 1 time in total.

philat
Eileen-Class Veteran
Posts: 1909
Joined: Wed Dec 04, 2013 12:33 pm
Contact:

Re: Character Limit for Player Input Save Game Name

#2 Post 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

User avatar
sheetcakeghost
Veteran
Posts: 383
Joined: Sat Sep 19, 2009 9:19 pm
Contact:

Re: Character Limit for Player Input Save Game Name

#3 Post by sheetcakeghost »

Lovely! Does just what I needed.

Post Reply

Who is online

Users browsing this forum: apocolocyntose, Google [Bot]