help, Workaround for TextBox in CocoonJS?

Get help using Construct 2

Post » Sun May 19, 2013 9:29 am

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
B
9
S
1
Posts: 13
Reputation: 532

Post » Sun May 19, 2013 10:03 am

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.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sun May 19, 2013 10:57 am

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
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Sun May 19, 2013 12:40 pm

thanks :D

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

thanks
B
9
S
1
Posts: 13
Reputation: 532

Post » Fri May 24, 2013 5:34 am

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
http://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 :(
B
9
S
1
Posts: 13
Reputation: 532

Post » Fri May 24, 2013 5:48 am

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

[quote]CocoonJS object: ability to prompt a dialog to get text input. Useful workaround to the text box form controls not working.[/quote]

Perhaps you might want to check it out.
Always keep to the latest version available.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri May 24, 2013 6:22 am

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 :Dorangpelupa2013-05-24 08:04:11
B
9
S
1
Posts: 13
Reputation: 532


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests