How do I make Letter recognition

Get help using Construct 2

Post » Thu Nov 19, 2015 3:59 pm

Hi
Is it possible to make letter recognition?
For example, if typed "H" in text box then showing picture with "H"
if typed "O" in text box then showing picture with "O" and so on.

https://www.dropbox.com/s/qxpuqnams7lu9 ... .capx?dl=0
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Thu Nov 19, 2015 4:52 pm

use frames..not sprite objects...
or..you can always build a custom spritefont...

RegexFrames+SpriteFont.capx
Image
B
61
S
23
G
7
Posts: 1,461
Reputation: 10,686

Post » Sat Nov 21, 2015 9:02 am

@korbaach

Thank you, great example!
I added respective sounds
But i don't know how to make letters with sound.

I want to do this:
After write some text in textbox and click button
letters appears and sound with respective sound
Can you help with this?

https://www.dropbox.com/s/ap60sq6zrkb14 ... .capx?dl=0
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Sat Nov 21, 2015 10:01 am

Chigabooga wrote:I want to do this:
After write some text in textbox and click button
letters appears and sound with respective sound..


I guess... you need some delay ("typing effect") when you create letter sprites..

Image

so..you can't use loop(actually...never mind)...

try this one:

LetterSpriteSound.capx
Image
B
61
S
23
G
7
Posts: 1,461
Reputation: 10,686

Post » Sat Nov 21, 2015 10:55 am

@korbaach
Awesome!!
Thank you very much!

Just interesting what is "g" in string RegexSearch(SpriteCharacters, Letter, "g")?
Why not "b" or other letter?
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Sat Nov 21, 2015 11:02 am

Chigabooga wrote:@korbaach
Awesome!!
Thank you very much!

Just interesting what is "g" in string RegexSearch(SpriteCharacters, Letter, "g")?
Why not "b" or other letter?


http://www.w3schools.com/jsref/jsref_obj_regexp.asp
If your vision so exceeds your ability, then look to something closer.
Moderator
B
126
S
29
G
73
Posts: 5,086
Reputation: 51,992

Post » Sat Nov 21, 2015 11:15 am

Chigabooga wrote:Just interesting what is "g" in string RegexSearch(SpriteCharacters, Letter, "g")?
Why not "b" or other letter?


in this particular case..i think ..you can replace "g" with "i" or "m"..and it would not affect the code
like @zenox98 reference "g" is Modifier in Regular expression...

Image

Just search net and forum for Regular expression
Image
B
61
S
23
G
7
Posts: 1,461
Reputation: 10,686

Post » Sat Nov 21, 2015 11:48 am

Thank for explanation.
It's something new to me.
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Mon Nov 23, 2015 6:18 pm

@korbaach
Last question,
I added sounds named with russian letters "а" "б" "в" "г" "д"
In construct works everything ok,
but when i compiling apk in Intel XDK it's not compiling
some error occured
I now problem in russian letters "а" "б" "в" "г" "д"
How to solve this problem? I tried to make russian letters "а" "б" "в" "г" "д"
global, but no luck.

https://www.dropbox.com/s/pood51pt0zar2 ... .capx?dl=0
Image
B
14
S
6
G
5
Posts: 99
Reputation: 3,825

Post » Mon Nov 23, 2015 6:46 pm

ok..try diffrent way..rename sounds..

а->frame with picture of "a" .(ogg&m4a)
б->frame with picture of "б"
.
.
..so if "д" is on frame 20..rename sound д to 20(ogg&m4a)

then you can use Audio play str(SpriteText.AnimationFrame)
Image
B
61
S
23
G
7
Posts: 1,461
Reputation: 10,686

Next

Return to How do I....?

Who is online

Users browsing this forum: jhjconstruct, Tuiii and 6 guests