Input for desktop and mobile devices

Get help using Construct 2

Post » Thu Jun 09, 2016 8:47 am

Hello again to all,

today my question is: If i generate a game for html, and i want to upload it to my website, is there a possability to use a input which recognizes on which platform i open the game?

Currently ive included both - mouse and touch input. But if there both enabled, the calculation of some input values gets weird. (Input positions arend correct)
Basically i need the game to run on each device.

One Excample:
Iam using Set Location_Global_X to Mouse.X (OnClick) and in my touch function Set Location_Global_X to Touch.X (Is in touch). But both values are different (of course they may not exact the same but the click area should be near by)
This functions arent enabled at the same time, to make sure they doesnt interrupt each other.

Is there a possibility to have an input which works for both input systems? The coordinates should be the same on desktop and on mobile devices. (I need this for my minimap to main map transition which works on desktop but not on my mobile device.

I hope there is a solution for this kind of "problem"

best regards and thanks in advance
B
11
S
2
Posts: 163
Reputation: 1,123

Post » Thu Jun 09, 2016 2:25 pm

Touch properties

Use mouse input
If set to Yes, mouse clicks will simulate touch events. Clicking and dragging the left mouse button will simulate a touch along where mouse dragged, and single clicks will simulate taps. This can be very useful for testing touch events work properly on a desktop computer with no touch input supported. However, only single-touch input can be simulated with a mouse, and a mouse is much more precise than a touch, so it is still best to test on a real touchscreen device.

Could this maybe work for you .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Thu Jun 09, 2016 2:45 pm

@granpa Thanks for your answer! Could you tell me where i can find this option? Or where i have to set it up? If the mouse and the touch input will be triggered as the same, this would be the greatest solution for me - not only for testing as for the final input method.

Thank your very much!
B
11
S
2
Posts: 163
Reputation: 1,123

Post » Thu Jun 09, 2016 2:58 pm

click on touch ,check it in properties
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Fri Jun 10, 2016 9:24 am

Thanks granpa! :) Can i use this option for realease too? Or is this options intention only for debugging?
B
11
S
2
Posts: 163
Reputation: 1,123

Post » Fri Jun 10, 2016 1:41 pm

I have and had no problems .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499


Return to How do I....?

Who is online

Users browsing this forum: JaredX, Ryan Kocourek and 25 guests