0 Favourites

help, Workaround for TextBox in CocoonJS?

  • Hello

    i have searched on forums and the conclusion is that i cant use textbox on CocoonJS.

    Is there an alternative or workaround to make textbox in CocoonJS?

    what i want to do is making quiz game with textbox which behave something like this:

    if [textbox == appleisred]

    answer are correct!

    Thanks :D

  • I wouldn't call it a workaround, but you could make your own on-screen keyboard.

    To cut back on needing an event for every single key, put all the keys into a family, create a family variable called key or something and assign the corresponding letter to each key. When the user taps a key, add its key value to the end of a text object (the contents of which are tested to determine if the user is correct or now). Include a backspace key to remove the letter on the end of the text object.

    That should be all you need, I don't think different letter cases would be necessary.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • I thought this was an interesting challenge, so I made an example for you: here you go. It also includes haptic feedback on mobile, because why not :P

  • thanks :D

    it seems you use construct2 beta 130. i'll try the capx adter finish downloading it

    thanks

  • hello :D

    i tried the code, it works. I can type, it also can check the typed word are correct. But i can't make the virtual keyboard showing button text.

    here the screenshot

    i.imgur.com/HwPjlkW.jpg

    can you tell me how you make your virtual keyboard have button text? I have tried copied the script from your capx but still not work :(

  • An improvement to CocoonJS has been added in r131, and is available in the current r132 as well.

    ocoonJS object: ability to prompt a dialog to get text input. Useful workaround to the text box form controls not working.

    Perhaps you might want to check it out.

    Always keep to the latest version available.

  • hi Kyatric,

    thanks the info.

    i have installed 132 and use the cocoonjs specific dialogue.

    But can i test it using web browser on PC? Maybe with more trigger?

    Or i must compile it on cocoon cloud and install it on my android?

    I tried running it on PC using chrome but nothing happend :(

    i need to know in how and what variable the coocoonJS dialogue will save the text.

    Then compare it with pre defined text value (the correct answer for quiz game)

    thanks

    EDIT:

    yay, the virtual keyboard able to display the key label :D.

    i changed the spawn layer from "0" to "2" :D

    thanks the replies everyone :D

    EDIT2:

    ouch using virtual keyboard freeze my whole game on cocoonjs :/

    EDIT3:

    The virtual keyboard works after i restart my phone :D

    GeometriX's keyboard works on CocoonJS. Anyone wants the CocoonJS workaround that tried it and got problem, try restart the android phone.

    Works like a charm for me :D

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
CocoonJS plugin updates
519 48,595
tuzke's avatar
tuzke
Unread hot topic
392 34,831
Joannesalfa's avatar
Joannesalfa
Unread hot topic
0 Favourites
CocoonJS 1.4 update
130 21,589
tamngon's avatar
tamngon