How do I draw/read touch gestures?

Get help using Construct 2

Post » Thu Nov 24, 2016 8:58 pm

I think a question of something similar has been asked and answered, but mine is different:

So, say I want the system to perform an action when a circle is drawn on the screen, in the middle. I want to be able to draw a circle on the screen, then, as soon as you stop drawing it, the system would read the canvas and say "well hey that's a circle" and associate that with a certain action.
Basically, I want to have the system associate different hand-drawn symbols with pre-programmed symbols, and perform an action after the user-friendly symbol is associated with the system's symbol in its memory.
Can I do this in a practical way, and if so, how would I go about doing this?
Posts: 3
Reputation: 181

Post » Fri Nov 25, 2016 10:45 pm

This is a real tough thing to program and that's probably why you didn't get any responses yet.
If you are trying to do this as a hobbyist, you would probably be better off trying to control the input by a different system.

This requires a really good, strong and complex algorithm. It is possible, but the only useful stuff I found when googling for this was by university professors. (e.g. here)

If this is doable at all, there are probably just a few people in this forum who can help you, most likely @R0j0hound.

I don't want to crush your "dreams", but I think you would make life a lot easier for yourself if you considered a different approach. ;)
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
Posts: 528
Reputation: 7,091

Post » Sat Nov 26, 2016 4:23 am

I made a very rough and quick version of how I would do gestures. feel free to give it a try/look.
I suggest clicking once before doing anything. This clears the screen.

browser test
password: construct

capx ... 0test.capx

Some explanation of that implementation. Basically, I have shapes or gesture symbols created. if the touchpoints follow along the general shape, then a gesture action can be performed.

If I were to take it a step further I would have the gesture shapes try and resize themselves to see if it can find a better gesture match.
I would also have the gesture symbol flip and rotate a few times to attempt and find a better match.

To take the accuracy even further I would place image points on key locations to each gesture and make sure a touch point falls within that area. This would help in accurately determining a gesture.

Im sure there are also other ways to go about this, but this way is quick and mostly effective.
Posts: 226
Reputation: 2,990

Post » Sat Nov 26, 2016 8:46 am

Posts: 281
Reputation: 6,143

Post » Sat Nov 26, 2016 3:16 pm

Aight, thanks for all your responses. @Tylermon, thanks a bunch, I'll try your .capx out in a bit. @randomly, thanks for the link, and I'll probably check with r0j0 at some point to see if it's able to be made in C2. @Laurent, thanks for the link as well, I'll check out the plugin.
Posts: 3
Reputation: 181

Post » Sat Nov 26, 2016 3:19 pm

@Tylermon, just checked out the browser preview, this is really great. I understand what you mean by "touch points", so I'll see if I can build off this. Thanks a lot ^-^
Posts: 3
Reputation: 181

Return to How do I....?

Who is online

Users browsing this forum: kelvinb and 4 guests