renpy.input() in Android
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.
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.
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
renpy.input() in Android
I have a renpy.input() line in my game to ask the player's name. But it's not working in Android. Do I need to do something or simply is not (yet) a feature in Android?
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- PyTom
- Ren'Py Creator
- Posts: 16093
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: renpy.input() in Android
It doesn't work in Android.
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
Re: renpy.input() in Android
You can still use user input by bypassing renpy.input for android and use this (not my code but could be handy):
The actual soft keyboard code is
Again, this may be bloated for your needs, but should work anyway (I don't have an Android device to test it myself, but heard it works).
Code: Select all
# replace your renpy.input call with this.
if not renpy.variant('touch') and povName == '':
info "Please enter your name."
$ povFirstName = renpy.input("What is your first name?") or "Name"
$ povLastName = renpy.input("What is your last name?") or "Surname"
$ povName = povFirstName +" "+povLastName
if renpy.variant('touch') and povName == '':
info "What is your first name? (leave blank for 'Name')"
$ input_header = 'First name:'
call inputter
$ povFirstName = input_text or "Name"
info "What is your last name? (leave blank for 'Surname')"
$ input_header = 'Last name:'
$ text_group = 1
$ input_text = ''
call inputter
$ povLastName = input_text or "Surname"
$ povName = povFirstName +" "+povLastName
Code: Select all
########################################################
# Android keyboard input stuff, adapted from: http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=14985
python:
text_list1=["Q","W","E","R","T","Y","U","I","O","P","0",
"A","S","D","F","G","H","J","K","L","0",
"Z","X","C","V","B","N","M","0"]
text_list2=["q","w","e","r","t","y","u","i","o","p","0",
"a","s","d","f","g","h","j","k","l","0",
"z","x","c","v","b","n","m","0"]
input_text = ''
input_header = 'NAME:'
text_limit = 16
text_list=text_list1
text_group=1
########################################################
# More android keyboard input stuff, adapted from: http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=14985
label inputter:
if text_group==1:
$text_list=text_list1
elif text_group==2:
$text_list=text_list2
$ ui.frame(xpos=0.5, ypos=0.1, xanchor=0.5, yanchor=0, xminimum=450)
$ ui.vbox()
$ ui.text(input_header+" "+input_text)
$ ui.null(height=30)
$ ui.hbox()
$ ui.textbutton("Done", clicked=ui.returns("Done"))
$ui.textbutton("Backspace", clicked=ui.returns("Backspace"))
$ui.textbutton("Delete all", clicked=ui.returns("Deleteall"))
if text_group==1:
$ ui.textbutton("Caps (On)", clicked=ui.returns("lowercase"))
elif text_group==2:
$ ui.textbutton("Caps (Off)", clicked=ui.returns("uppercase"))
$ ui.close()
$ ui.null(height=10)
$ ui.hbox(xalign= 0.5)
python:
for text_code in text_list:
if text_code=="0":
ui.close()
ui.hbox(xalign= 0.5)
elif len(input_text)<=text_limit-1:
ui.textbutton(text_code, clicked=ui.returns(text_code))
$ ui.close()
$ ui.close()
$ button_selection=ui.interact()
if button_selection=="Backspace":
$ input_text=input_text[:-1]
jump inputter
elif button_selection=="Deleteall":
$ input_text=''
jump inputter
elif button_selection=="uppercase":
$text_group=1
jump inputter
elif button_selection=="lowercase":
$text_group=2
jump inputter
elif button_selection=="Done":
return
$ select_text=button_selection
python:
for text_code in text_list:
if select_text==text_code:
input_text += text_code
jump inputter
- xavimat
- Eileen-Class Veteran
- Posts: 1461
- Joined: Sat Feb 25, 2012 8:45 pm
- Completed: Yeshua, Jesus Life, Cops&Robbers
- Projects: Fear&Love
- Organization: Pilgrim Creations
- Github: xavi-mat
- itch: pilgrimcreations
- Location: Spain
- Discord: xavimat
- Contact:
Re: renpy.input() in Android
Thanks!
I'll check the code.
I'll check the code.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: renpy.input() in Android
Hey, this is great! The only change I needed to make was to change the "python:" to "init python:" so it would run before everything else. I tested it on Android and it works great. Thank you!
Re: renpy.input() in Android
Hello friends, the code works perfectly but it´s too small for my screen (1366x768) . How can I make bigger the keyboard?.
-
- Regular
- Posts: 120
- Joined: Mon Aug 29, 2011 11:01 am
- Projects: | ZUKUNFT | Wayang Kulit - A Shadow Play (WIP version 0.1) |
- Location: Germany
- Contact:
Re: renpy.input() in Android
Oh, great! Will try this out! Thank you!
- qirien
- Miko-Class Veteran
- Posts: 541
- Joined: Thu Jul 31, 2003 10:06 pm
- Organization: Metasepia Games
- Deviantart: qirien
- Github: qirien
- itch: qirien
- Location: New Mexico, USA
- Discord: qirien
- Contact:
Re: renpy.input() in Android
stwkun, it just uses your default font size. I think it is small on purpose so that it will also work with phones that have smaller resolutions.
If you really want to make it larger, you'd probably need to make a new style and tell the text buttons to use it? I'm still learning about styles, so I'm not sure how to do that...
If you really want to make it larger, you'd probably need to make a new style and tell the text buttons to use it? I'm still learning about styles, so I'm not sure how to do that...
Re: renpy.input() in Android
qirien, I am trying to find the answer, but I couldn't . I modified many time the codes and I believe the solution could be in this line
I changed to this
but in the keyboard not apears the letters , only appears 'text code' , logic, isn't it?
I don't know how to make work "text_code" and also appears bigger in my screen
If someone find the solution, tell me please
Code: Select all
ui.textbutton(text_code, clicked=ui.returns(text_code))
Code: Select all
ui.textbutton("{size=30}\'text_code\'{/size} ",clicked=ui.returns(text_code))
I don't know how to make work "text_code" and also appears bigger in my screen
If someone find the solution, tell me please
- dyrarendy
- Regular
- Posts: 59
- Joined: Wed Apr 02, 2014 12:26 pm
- Projects: Visual Novel Dating Sims Masa SMA
- Location: Indonesia, Cimahi
- Contact:
Re: renpy.input() in Android
anyway.....
Dont change per letter, just "replace all" : ( ," with ,"{size=+14} ) and ( ", with {/size}", )
or, try this :
http://www.kreativrauschen.com/blog/200 ... -in-renpy/
Code: Select all
init python:
text_list1=["{size=+14}Q{/size}","{size=+14}W{/size}","{size=+14}E{/size}","{size=+14}R{/size}","{size=+14}T{/size}","
{size=+14}Y{/size}","{size=+14}U{/size}","{size=+14}I{/size}","{size=+14}O{/size}","{size=+14}P{/size}","0",
"{size=+14}A{/size}","{size=+14}S{/size}","{size=+14}D{/size}","{size=+14}F{/size}","{size=+14}G{/size}","
{size=+14}H{/size}","{size=+14}J{/size}","{size=+14}K{/size}","{size=+14}L{/size}","0",
"{size=+14}Z{/size}","{size=+14}X{/size}","{size=+14}C{/size}","{size=+14}V{/size}","{size=+14}B{/size}","
{size=+14}N{/size}","{size=+14}M{/size}","0"]
text_list2=["{size=+14q{/size}","{size=+14}w{/size}","{size=+14}e{/size}","{size=+14}r{/size}","{size=+14}t{/size}","
{size=+14}y{/size}","{size=+14}u{/size}","{size=+14}i{/size}","{size=+14}o{/size}","{size=+14}p{/size}","0",
"{size=+14}a{/size}","{size=+14}s{/size}","{size=+14}d{/size}","{size=+14}f{/size}","{size=+14}g{/size}","
{size=+14}h{/size}","{size=+14}j{/size}","{size=+14}k{/size}","{size=+14}l{/size}","0",
"{size=+14}z{/size}","{size=+14}x{/size}","{size=+14}c{/size}","{size=+14}v{/size}","{size=+14}b{/size}",
"{size=+14}n{/size}","{size=+14}m{/size}","0"]
Code: Select all
$ ui.textbutton("{size=+10}Selesai{/size}", clicked=ui.returns("Done"))
$ui.textbutton("{size=+10}Hapus{/size}", clicked=ui.returns("Backspace"))
$ui.textbutton("{size=+10}Hapus Semua{/size}", clicked=ui.returns("Deleteall"))
if text_group==1:
$ ui.textbutton("{size=+10}Caps (On){/size}", clicked=ui.returns("lowercase"))
elif text_group==2:
$ ui.textbutton("{size=+10}Caps (Off){/size}", clicked=ui.returns("uppercase"))
Code: Select all
if button_selection=="Backspace":
$ input_text=input_text[:-18]
jump inputter
or, try this :
http://www.kreativrauschen.com/blog/200 ... -in-renpy/
Re: renpy.input() in Android
I tried this modification before and looks like it worked, but when the game start the name from character appears with diferent size from the the script, also when you put a name then you decide erased the text, the game failed.
I found a posible solution, I tried this
I modify this line, with empty button, the I created a Keyboard in png (teclado.png)
well, with this is the solution that I found
I found a posible solution, I tried this
Code: Select all
ui.textbutton('{size=+50} {/size}', clicked=ui.returns(text_code))
Code: Select all
$ input_header = 'Ingrese apellido:'
show teclado
- dyrarendy
- Regular
- Posts: 59
- Joined: Wed Apr 02, 2014 12:26 pm
- Projects: Visual Novel Dating Sims Masa SMA
- Location: Indonesia, Cimahi
- Contact:
Re: renpy.input() in Android
great idea, to make keyboard.png
but, is it really { size 50 } ?
what resolution your game now ?
but, is it really { size 50 } ?
Code: Select all
ui.textbutton('{size=+50} {/size}', clicked=ui.returns(text_code))
- dyrarendy
- Regular
- Posts: 59
- Joined: Wed Apr 02, 2014 12:26 pm
- Projects: Visual Novel Dating Sims Masa SMA
- Location: Indonesia, Cimahi
- Contact:
Re: renpy.input() in Android
I think its done now.
Well, I make a New Thread for this, feel free to visits :
http://lemmasoft.renai.us/forums/viewto ... 07#p317807
Well, I make a New Thread for this, feel free to visits :
http://lemmasoft.renai.us/forums/viewto ... 07#p317807
Re: renpy.input() in Android
Great, you also solve the last part, put caps (on - off.) thank you
I have another problem, I am trying to solve but until now I couldn't
I would like you help me to find the solution
http://lemmasoft.renai.us/forums/viewto ... =8&t=25908
I have another problem, I am trying to solve but until now I couldn't
I would like you help me to find the solution
http://lemmasoft.renai.us/forums/viewto ... =8&t=25908
Who is online
Users browsing this forum: babayi0827, Semrush [Bot]