Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Question about Touchscreen vs mouse regarding getspritetesthit

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 11th Apr 2018 00:10
If there is a mouse and I hover over the sprite I get that is a positive hit. What happens with touchscreen? Does the finger/pen have to be touching the screen? And once released there is no longer a hit? Or does it "save" the last position mimicking the mouse pointer just staying in one place, therefore, producing a hit?

Thanks
Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 11th Apr 2018 21:34 Edited at: 11th Apr 2018 21:38
I think that with current screens you have to touch them (but there are screens now where it can feel a hovering finger, but they are not widely used yet, so no). And for save of position of the last touch, you just store that touch in some variables (or arrays, or whatever you like to store stuff in).

EDIT: Just read a little up on hovering fingers, some screens can read a finger very close to the screen, but they count as a touch. Some screens are now able to distinguish between a touch and a hover, but still, not widely used yet.
13/0
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 12th Apr 2018 08:40
Generally you will want to combine your check with
GetPointerReleased()
(Or some version of that command)
otherwise you will get unexpected (or simply annoying for the user) results.
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 12th Apr 2018 14:25
It does indeed stay as a hit, which I think is pretty cool. Once the user presses a different area it will change to no/another spriteID.


Login to post a reply

Server time is: 2024-11-21 16:12:47
Your offset time is: 2024-11-21 16:12:47