Using both the Mouse and Touch objects, possible?

Get help using Construct 2

Post » Mon Jul 22, 2013 6:00 pm

I've come across a small problem where i have a start screen that sets a variable to either "mouse" or "touch" depending on which interaction has been done. This works fine and the main screen loads.

The issue for me is that i'm not sure of which is the best approach when trying to resolve the input method? In my code i try to use both according to the top part of this image:



The code above is the way i tried first, that is if the mouse is over OR touch i touching. However, they seem to conflict and only the touch works. So underneath it you see the approach that did work but since i am using one event sheet for my whole game, there is a risk that i will have to put it a lot of input checks.

My question is if there is a better way, perhaps somehow to utilize a function for these repeating checks?
B
7
S
1
Posts: 38
Reputation: 405

Post » Mon Jul 22, 2013 6:15 pm

You could just use the touch object if you're only going to use left mouse-button input.

Touch object is set on use mouse input in the start.
On touch is the same as on mouse left button down in that case.
You cant use mouse-pointer in touch.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 22, 2013 6:28 pm

If you want to use a different input method for mouse and touch i suggest making a mouse group of events and a touch group of events. If on touchscreen disable mouse-group and if mouse is available disable touch-group.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 22, 2013 6:30 pm

Ya ok... yeah sorry, i already new about the Touch "act as mouse" type of setting. The thing is that i want to scale the graphics on mobile devices and since my Galaxy S4 and PC have the same resolution, i need some other way to tell them apart. Is there like a "is desktop" or "is smartphone" check?
B
7
S
1
Posts: 38
Reputation: 405

Post » Mon Jul 22, 2013 6:37 pm

yes, there is a system condition Is on mobile device.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jul 22, 2013 7:04 pm

Superb thanks! ^^
B
7
S
1
Posts: 38
Reputation: 405

Post » Wed Apr 02, 2014 10:26 am

LittleStain wrote:If you want to use a different input method for mouse and touch i suggest making a mouse group of events and a touch group of events. If on touchscreen disable mouse-group and if mouse is available disable touch-group.


Would you have a sample .capx on this?
B
7
Posts: 19
Reputation: 345


Return to How do I....?

Who is online

Users browsing this forum: Elliott, hntr, wiredcleric, Yahoo [Bot] and 10 guests