Lemma Soft Forums

Supporting creators of visual novels and story-based games since 2003.

Visit our new games list, blog aggregator, IRC channel, and Discord (new).
Activation problem? Email pytom@bishoujo.us.
It is currently Tue May 30, 2017 3:16 am

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri May 12, 2017 5:34 am 
Regular
User avatar

Joined: Tue Sep 27, 2011 10:37 am
Posts: 148
Location: France
Projects: Anges Démoniaques, Gang
Hi!

I tried to follow everything here ==>
viewtopic.php?f=51&t=25972&p=317807#p317807

But the image for the keys of the keyboard appeared under the empty keyboard:
https://www.dropbox.com/s/4yw37r3nv6u6u ... d.JPG?dl=0

So I decided to use another code but that line causes problem:
Code:
                ui.textbutton('{size=+60}   {/size}', clicked=ui.returns(text_code))


It was supposed to change the size of all the buttons. Instead, the font just... Disappears...
https://www.dropbox.com/s/kj58x0ic4j3ka ... t.JPG?dl=0

When the code is:

Code:
                ui.textbutton(text_code, clicked=ui.returns(text_code))


It works, however the text is way too small and I need it at size 60:
https://www.dropbox.com/s/buths4aja67c1 ... l.JPG?dl=0

Here is the full code:

Code:
init python:
    text_list1=["A","Z","E","R","T","Y","U","I","O","P","0",
                      "Q","S","D","F","G","H","J","K","L","M","0",
                      "W","X","C","V","B","N","É","È","-","0"]
    text_list2=["a","z","e","r","t","y","u","i","o","p","0",
                      "q","s","d","f","g","h","j","k","l","m","0",
                      "w","x","c","v","b","n","é","è","-","0"]
    input_text = ''
    input_header = 'Name:'
    text_limit = 16
    text_list=text_list1
    text_group=1

################

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.3, xanchor=0.5, yanchor=0, xminimum=450)
    $ ui.vbox()
    $ ui.text(input_header+" "+input_text)

    $ ui.null(height=30)

    $ ui.hbox()

    $ ui.textbutton("VALIDER", clicked=ui.returns("Done"))
    $ui.textbutton("RETOUR", clicked=ui.returns("Backspace"))
    $ui.textbutton("EFFACER", clicked=ui.returns("Deleteall"))
    if text_group==1:
        $ ui.textbutton("MAJ", clicked=ui.returns("lowercase"))
    elif text_group==2:
        $ ui.textbutton("MIN", 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


Can someone help me solve this?

If you have tips to create a keyboard based only on imagebuttons, I'm also interested.

Thank you in advance!

_________________
Image


Last edited by Meg' on Sun May 14, 2017 4:47 am, edited 1 time in total.

Top
 Profile Send private message  
 
PostPosted: Sun May 14, 2017 4:46 am 
Regular
User avatar

Joined: Tue Sep 27, 2011 10:37 am
Posts: 148
Location: France
Projects: Anges Démoniaques, Gang
I found a solution by adding a style to the text and the text_button in the init here:

Code:
init python:
    text_list1=["A","Z","E","R","T","Y","U","I","O","P","0",
                      "Q","S","D","F","G","H","J","K","L","M","0",
                      "W","X","C","V","B","N","É","È","-","0"]
    text_list2=["a","z","e","r","t","y","u","i","o","p","0",
                      "q","s","d","f","g","h","j","k","l","m","0",
                      "w","x","c","v","b","n","é","è","-","0"]
    input_text = ''
    input_header = 'Name:'
    text_limit = 16
    text_list=text_list1
    text_group=1

[b]    style.text.size = 50
    style.button_text.size = 50[/b]

_________________
Image


Top
 Profile Send private message  
 
PostPosted: Sun May 14, 2017 10:57 pm 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14630
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
This is also ancient code. Nowadays, you can just use renpy.input and the keyboard will show up. (You may have to tweak the input screen so it's on the top half of the screen, so the keyboard doesn't overlap it.)

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
PostPosted: Wed May 17, 2017 6:27 am 
Regular
User avatar

Joined: Tue Sep 27, 2011 10:37 am
Posts: 148
Location: France
Projects: Anges Démoniaques, Gang
This is what I'm actually using.

I wanted to implement the keyboard without renpy.input because a few users couldn't see the keyboard when they had to enter their name (I think this has to do with an old version of android ==> 2.3 or 2.7). To solve that, I wanted to use text.input and not renpy.input.

When building the apk file and choosing which version of android I'm targeting, will that affect the keyboard showing up or not for users of android 2.3 and 2.7?

_________________
Image


Top
 Profile Send private message  
 
PostPosted: Thu May 18, 2017 1:53 am 
Ren'Py Creator
User avatar

Joined: Mon Feb 02, 2004 10:58 am
Posts: 14630
Location: Kings Park, NY
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Twitter: @renpytom
Github: renpytom
itch.io: renpytom
I don't think it should. The input screen should trigger the os to display the keyboard. That should work on any device that has an onscreen keyboard. At the same time - 2.3 is 6 years old, no longer supported, and there isn't an android 2.7.

_________________
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Code > Drama
https://www.patreon.com/renpytom


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Protected by Anti-Spam ACP
Powered by phpBB® Forum Software © phpBB Group