• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py Moving Input in Android (to avoid keyboard)

Impious Monk

Active Member
Game Developer
Oct 14, 2021
594
2,562
I'm porting my Ren'py game over to Android and I've got just one problem left to solve. When the game asks the player to input a first name, the keyboard covers up whatever is being typed in by the player. I've read that the solution to this is to move the input upwards, but I have not been able to figure out how to implement that solution. Any assistance would be appreciated. Here is the code I've got:

Code:
    xx "In {i}Leaving DNA{/i}, you will play the role of Assistant District Attorney Rockford."
    $ mc_name = renpy.input("What is your first name? (leave blank for default)", length=16)
    $ mc_name = mc_name.strip()
    if not mc_name:
        $ mc_name = "John"
    xx "Your name is [mc_name] Rockford."
 

rayminator

Engaged Member
Respected User
Sep 26, 2018
3,040
3,118
there might be a away but you will need to code it by yourself by using google voice controls somehow

meaning of code it by yourself
it hasn't been done before with renpy that I know of... so it might work or it might not work
 
  • Like
Reactions: Impious Monk

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,211
14,962
I've read that the solution to this is to move the input upwards, but I have not been able to figure out how to implement that solution.
Open the "screen.rpy" file, then search the screen named "input". You'll find a vbox, and have to change the value for the ypos property.

But you'll probably want something a bit better, so this should do it:
Python:
screen input(prompt):
    style_prefix "input"

    window:

        vbox:
            xalign gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            if renpy.variant("touch"):  #
                ypos 100                #
            else:                       #
                ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"
 
  • Like
Reactions: Impious Monk

Impious Monk

Active Member
Game Developer
Oct 14, 2021
594
2,562
Open the "screen.rpy" file, then search the screen named "input". You'll find a vbox, and have to change the value for the ypos property.

But you'll probably want something a bit better, so this should do it:
Python:
screen input(prompt):
    style_prefix "input"

    window:

        vbox:
            xalign gui.dialogue_text_xalign
            xpos gui.dialogue_xpos
            xsize gui.dialogue_width
            if renpy.variant("touch"):  #
                ypos 100                #
            else:                       #
                ypos gui.dialogue_ypos

            text prompt style "input_prompt"
            input id "input"
Thank you, Anne!