Create an analog stick at touch ID?

Get help using Construct 2

Post » Wed Apr 17, 2013 6:02 am

This has baffled me for too long and I've probably bumped too many old threads that seemed to have a 'working' solution by now, all to no avail.

Test it on mobile here and see that touch IDs revert to -1 insanely fast.

Here is what the event sheet looks like for the left controls:


...and for the right controls:


I will share a .capx with any trustworthy members on this forum who are itnerested, but I won't post a .capx publicly due to the possibility of my art assets being stolen.

Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 6:47 am

Why don't you just try to write out what you want to do in the off chance touch id doesn't work the way you expect it to?
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Wed Apr 17, 2013 7:03 am

So limit the game to only one touch? No thanks.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 7:49 am

Touch has one of largest lists of expressions, and it never occured to you that something else like say touch index might work instead?
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Wed Apr 17, 2013 7:56 am

It looks like your trying for dual analog

If you can make sense of the tutorial page
https://www.scirra.com/tutorials/398/touch-stick-controllers/page-3

Also you can download the tutorial capx
https://www.scirra.com/tutorials/398/touch-stick-controllers/page-5


Hope any of this helps, but the tutorial was created to get touch analog sticks working. Including dual analog. Good luck.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Wed Apr 17, 2013 8:08 am

[QUOTE=newt] Touch has one of largest lists of expressions, and it never occured to you that something else like say touch index might work instead?[/QUOTE]

Before suggest to me touch index, please realize that touch index increases based on the number of touches.

So first touch = 0, second touch = 1, etc.

But does that really work for an analog stick?
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 8:13 am

[QUOTE=jayderyu] It looks like your trying for dual analog

If you can make sense of the tutorial page
https://www.scirra.com/tutorials/398/touch-stick-controllers/page-3

Also you can download the tutorial capx
https://www.scirra.com/tutorials/398/touch-stick-controllers/page-5


Hope any of this helps, but the tutorial was created to get touch analog sticks working. Including dual analog. Good luck. [/QUOTE]

Thanks. I'm saddened to see this is the ONLY tutorial in the Mobile section of the tutorials site. Are there really only a few people who have multitouch games made with C2?

Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 8:28 am

[QUOTE=Excal] [QUOTE=newt] Touch has one of largest lists of expressions, and it never occured to you that something else like say touch index might work instead?[/QUOTE]

Before suggest to me touch index, please realize that touch index increases based on the number of touches.

So first touch = 0, second touch = 1, etc.

But does that really work for an analog stick?[/QUOTE]

Nope, but it's more relevant than touch id.

Anyway you need to go from another direction. Try on object touched, or is touching.
Also please realize that treating people like they don't know what they are talking about does not help your situation.
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271

Post » Wed Apr 17, 2013 8:34 am

I have tried those. I have spent nearly a full day trying different possibilities with the touch behavior.

Apparently there is a specific setup you have to use to 'get it right', and I'm still trying to find what that is.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Wed Apr 17, 2013 4:37 pm

touch.index has near 0 relevance to multi touch gaming. it's only possible use is when you specifically want to organize based on a touch system of reducing and eliminating touches on a 0 based.

I cannot imagine any game where touch.index will be of use that isn't related to music.

prior to touch.touchID and touch.XYForID it was impossible to do multi touch input. Ashley gave it a try when I pushed subject on the difficulty. Thus now we have touchId. Still appreciate it :)

and yes excal it is sorta in a situation where you need to just get it right. I spent a month prior to touch.touchid and ForId to get dual analog working. I ended up using drag and drop behaviours instead of touch.index(as that was only natural multitouch available). It worked but it had a funny bit where the DD objects could not be stored in a sub folder for sorting :(

It's sorted out now.You can have dual/quad/hex/oct analog based controls now :P

=Group whatever=
var static tid = -1

onTouch Hudleft sprite
tid = -1
-- tid = touch.touchid


isTouching hud leftsprite
tid => 0
-- do your analog stuff
-- use touch.AbsoluteXForID or touch.XForId(you need to use ForId)

endTouch
touch.touchid = tid
-- end touch stuff
-- tid = -1

maybe you can minimize your capx and share it. I can barely effectivly read the imagesjayderyu2013-04-17 16:38:23
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Next

Return to How do I....?

Who is online

Users browsing this forum: linkman2004, R0J0hound, Yahoo [Bot] and 23 guests