How do I get an input from a drawing a shape?

Get help using Construct 2

Post » Sun Nov 13, 2016 9:10 am

Hey, so I want to make a game where you would draw something like a circle (predetermined shape) and then have a txt say something.

I've seen a couple of games where you have to draw shapes to destroy different enemies on screen and I never have been able to recreate a game like this...

I would try and set a sprite every tick or so when you are holding the mouse button, and I would have another sprite over witch I would draw the shape and check if it would not collide with it, but I want it to recognize these shapes where ever they would be drawn...

Do you guys have any idea how to do this?
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Sun Nov 13, 2016 9:52 am

There is a gesture recognizer plugin from Pode. Maybe that's what your looking for.

viewtopic.php?t=66773

Example:
https://dl.dropboxusercontent.com/u/141 ... index.html
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Sun Nov 13, 2016 10:15 am

Asmodean wrote:There is a gesture recognizer plugin from Pode. Maybe that's what your looking for.

viewtopic.php?t=66773

Example:
https://dl.dropboxusercontent.com/u/141 ... index.html

Yes, awesome!

Thanks Asmodean!
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Sun Nov 13, 2016 10:26 am

Asmodean wrote:There is a gesture recognizer plugin from Pode. Maybe that's what your looking for.

viewtopic.php?t=66773

Example:
https://dl.dropboxusercontent.com/u/141 ... index.html

Actually, it's having trouble finding custom shapes (Even simple ones like 1/2 circle...)
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Sun Nov 13, 2016 11:09 am

I can't really help. I never used the plugin for real.
You have to use forms that really distinguish from another, otherwise there too many overlaps. If I added an half circle it's mostly recognize as v or square bracket.
You have to delete the forms that are similar to the form you want to recognize.
Look at the capx and read the thread.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Sun Nov 13, 2016 11:21 am

Asmodean wrote:I can't really help. I never used the plugin for real.
You have to use forms that really distinguish from another, otherwise there too many overlaps. If I added an half circle it's mostly recognize as v or square bracket.
You have to delete the forms that are similar to the form you want to recognize.
Look at the capx and read the thread.

Oh... I was hoping to have quite a bit of similar shapes...
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Sun Nov 13, 2016 12:11 pm

TRMG wrote:Oh... I was hoping to have quite a bit of similar shapes...


That would be a bad idea, whatever how precise the recognition is.
That would frustrate player/user, because you have to be very exact in your gesture.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Mon Nov 14, 2016 12:25 am

Asmodean wrote:
TRMG wrote:Oh... I was hoping to have quite a bit of similar shapes...


That would be a bad idea, whatever how precise the recognition is.
That would frustrate player/user, because you have to be very exact in your gesture.

I meant as in 3/4 circle 1/2 circle 1/4 circle and full circle for example...
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493

Post » Mon Nov 14, 2016 12:23 pm

I don't know what you want to achieve with the gestures. It would be the best you test it yourself. Maybe it works.
If you use this example from Pode:
http://dl.dropbox.com/u/1412774/oneStro ... nDemo.capx

Use the 'Delete all defined gestures' action in the 'on Start of Layout' event to delete all gestures.
Now you can define your own gestures. On the first gesture you will get a javascript error, but I think it's normal, because the plugin tried to recognize the gesture, but there is none. Click on Ok to hide the javascript-error and type a name for your gesture at:'Add stroke example to custom type and Add the gesture-name.
If you now try our own gesture it should be recognized.
Add your other gestures and look if you are satisfied with the result.

Pode is still active here, If you have questions about his plugin you could ask him directly.
B
24
S
3
G
1
Posts: 451
Reputation: 2,165

Post » Mon Nov 14, 2016 5:19 pm

Asmodean wrote:I don't know what you want to achieve with the gestures. It would be the best you test it yourself. Maybe it works.
If you use this example from Pode:
http://dl.dropbox.com/u/1412774/oneStro ... nDemo.capx

Use the 'Delete all defined gestures' action in the 'on Start of Layout' event to delete all gestures.
Now you can define your own gestures. On the first gesture you will get a javascript error, but I think it's normal, because the plugin tried to recognize the gesture, but there is none. Click on Ok to hide the javascript-error and type a name for your gesture at:'Add stroke example to custom type and Add the gesture-name.
If you now try our own gesture it should be recognized.
Add your other gestures and look if you are satisfied with the result.

Pode is still active here, If you have questions about his plugin you could ask him directly.

Ok, I'll try it like you said.
Thanks for the help!
ImageImageImageImage
B
27
S
9
G
7
Posts: 229
Reputation: 5,493


Return to How do I....?

Who is online

Users browsing this forum: Davlin and 6 guests