Why is my touch control not showing up?

Get help using Construct 2

Post » Fri Apr 19, 2013 1:43 am

EDIT: NevermindExcal2013-04-19 01:47:58
Project Lead of Zems Online Card Game

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

Post » Fri Apr 19, 2013 1:47 am

I checked out your solution and I'm a bit confused.

It uses TouchIndex, which doesn't really solve my problem. You have to use TouchIDs to handle simultaneous touches.

When I touch the right side of the screen, the debug says the first touch is on the left, which is incorrect.
Project Lead of Zems Online Card Game

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

Post » Fri Apr 19, 2013 2:07 am

@Excal, I don't have real devices with touch to test it, but I'll work a little bit over this file to give you a better approach.

Maybe it can be a bug, and you also reported it, that's why I shut up my mouth before.

File updated.
@Excal, the best I can do while checking with mouse is there.

What I did is store the lastX for the first and second touch IDs, because I'm using mouse, when I press the second button, the first stop to work, so, the first X stop to update.

but, it is using the touch index, as you want.

Hope that helped.

https://dl.dropboxusercontent.com/u/47035927/Samples/touch_sample/index.html

https://dl.dropboxusercontent.com/u/47035927/Samples/SpaceGame_sample.capxTELLES08082013-04-19 02:09:08
ImageImageImageImageImageImage
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

Post » Fri Apr 19, 2013 2:08 am

Wait, what? I said touchindex doesn't work for this. You can't use touchindex for analog sticks.

TouchIndex is used if touch positions don't matter, but instead the number of touches matter.

In my game, only two touches will matter: a touch on the left and the touch on the right. Beyond two touches, nothing should happen. This makes TouchIndex less useful than TouchID, which according to jayderu is what you have to use.Excal2013-04-19 02:11:01
Project Lead of Zems Online Card Game

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

Post » Fri Apr 19, 2013 2:30 am

No problem Excal, as said, I don't have touch devices, so, it's impossible to test here any of the solutions to observe the results and say if it really can work or not.

"The issue I'm having now is the same touch ID is assigned to two different touches, or so I think.

Could you take a look? I've also reorganized the .capx based on your comments.

SpaceGame.capx

Thanks!"

The organization is looking much better.

EDITED: The file was updated to be filtering the touch with the specific touch index.TELLES08082013-04-19 02:37:40
ImageImageImageImageImageImage
B
93
S
20
G
14
Posts: 1,218
Reputation: 19,500

Post » Fri Apr 19, 2013 6:04 am

I'm still convinced the touch system in C2 is bugged. I have yet to see a demo with multiple touches that use TouchID instead of TouchIndex work. In particular, I've looked through the Creations forum and didn't find a single multitouch dual-analog game, so it could be that I'm trying something others haven't with C2 yet.

If someone can take a look at the .capx file, that would be awesome. The link on the first page is the updated link, but for anyone else: SpaceGame.capx
Project Lead of Zems Online Card Game

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

Post » Fri Apr 19, 2013 8:18 am

@philx

Can you share the .capx for the example you gave me earlier?
Project Lead of Zems Online Card Game

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

Post » Fri Apr 19, 2013 4:24 pm

@Excal

https://www.dropbox.com/s/j5v8oi5ruuyyp4y/multiple_touching.capx

here's the capx file. sorry for the delay I wasn't at home..

Here again a Live Demo
https://googledrive.com/host/0B7m-eoWIKsSMeVNlVzBzMTdFanM/index.html
B
23
S
6
G
5
Posts: 132
Reputation: 4,487

Post » Sat Apr 20, 2013 1:27 am

Thanks, philx.

I ended up just doing what you did, and to make two invisible sprites on screen. It seems to be working for me now.
Project Lead of Zems Online Card Game

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

Post » Sat Apr 20, 2013 5:37 am

@Excal any chance you can post a sample capx of the solution you came up with for two touch zones? I may have use of it in a future project.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests