wufik
|
|
Posted on: September 05, 2014, 02:44:29 am |
|
|
Joined: Nov 2013
Posts: 1
|
Hi, I'm trying to create a simple on-screen gamepad for use with a touchscreen on a Windows 8 tablet, but using mouse events doesn't work properly: - buttons must either be double tapped, or I have to tap and then move my finger a bit for the mouse click to register
- tough it's not that important to me, multitouch is obviously not supported
Does anyone know a simple to understand (or at least simple to implement without fully understanding? ) solution or workaround to my problems? I'd be grateful for any info, even if it's just "it can't be done with Enigma, period"
|
|
|
Logged
|
|
|
|
|
Josh @ Dreamland
|
|
Reply #2 Posted on: September 06, 2014, 10:38:42 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
I hate to suggest this, but, we could easily make mouse_x and y a var, and then assign multitouch points to the other indices. The less icky approach is just to create functions to fetch pointer information by index, and query the number and validity of pointers. Pointer information includes pressure and sometimes rotation (such as on the Wii). Validity isn't always a dense function—any of the four Wii remotes can be off-screen, and it would not surprise me if later tablets distinguish between fingers and one or more styluses.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
|
HitCoder
|
|
Reply #5 Posted on: September 16, 2014, 05:59:58 pm |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
What I'd do personally, is make it check if the mouse is on top of the object, and find the distance from the center to the mouse while the mouse distance is less than a certain amount. Not sure if that makes any sense, but it's an idea.
|
|
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
|
HitCoder
|
|
Reply #7 Posted on: September 28, 2014, 11:17:19 am |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
Hit, I think you misunderstood the problem. He needs multitouch support, because otherwise he can't even one click. You must double tap for windows to emulate one mouse click. There is nothing in GML/EDL he can do to stop that. Additional engine code must be written for that.
I still don't get it, I have a windows 8 tablet (can't run exes mind you), but it seems to be a single click on each tap on the screen. Anyway, my idea was not using mouse clicks, but to get the position of the cursor, and check the distance from the cursor, if it's below a certain amount, go to mouse_x and mouse_y
|
|
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
|
Goombert
|
|
Reply #9 Posted on: September 29, 2014, 03:58:45 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
I also checked on the GMC and got a response from Dailly -- GM doesn't even support multitouch on native Windows outside of building a Windows 8 app. It would be ideal to get this working for native in ENIGMA but we'll see what happens. What? It's literally part of WinAPI since Windows Vista. Don't worry I'll write the functions if I can find the time and throw them in an extension, they're real easy to do.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
daz
|
|
Reply #10 Posted on: September 29, 2014, 05:49:29 pm |
|
|
Joined: Jul 2010
Posts: 167
|
Yeah, here is the topic for reference: http://gmc.yoyogames.com/index.php?showtopic=638233#entry4656468My guess would be that he wants to ensure the games run on as many versions of Windows as possible, and by including touch support they'd be excluding XP and Vista. Maybe there's also a separate API for Windows 8 touch, I haven't looked too deeply into it.
|
|
|
Logged
|
|
|
|
edsquare
|
|
Reply #11 Posted on: September 29, 2014, 07:17:27 pm |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
Yeah, here is the topic for reference: http://gmc.yoyogames.com/index.php?showtopic=638233#entry4656468
My guess would be that he wants to ensure the games run on as many versions of Windows as possible, and by including touch support they'd be excluding XP and Vista. Maybe there's also a separate API for Windows 8 touch, I haven't looked too deeply into it.
But as an extension you can activate/desactivate it, or not?
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
daz
|
|
Reply #12 Posted on: September 30, 2014, 02:33:27 am |
|
|
Joined: Jul 2010
Posts: 167
|
But as an extension you can activate/desactivate it, or not?
Yes, but one doesn't exist. Someone would have to implement the Windows API calls in GML, or a DLL packaged into the extension. From within GM you can enable extensions per project. I (and Robert) would like to make an extension for ENIGMA to do it, which are also toggleable.
|
|
|
Logged
|
|
|
|
edsquare
|
|
Reply #13 Posted on: September 30, 2014, 07:11:29 am |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
But as an extension you can activate/desactivate it, or not?
Yes, but one doesn't exist. Someone would have to implement the Windows API calls in GML, or a DLL packaged into the extension. From within GM you can enable extensions per project.
I (and Robert) would like to make an extension for ENIGMA to do it, which are also toggleable.
What I meant was : If you implement it as an extension it can be activated/deactivated by the person making the game, so it should not present any problem with your games running on any OS.
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
Goombert
|
|
Reply #14 Posted on: September 30, 2014, 02:50:11 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
What I meant was : If you implement it as an extension it can be activated/deactivated by the person making the game, so it should not present any problem with your games running on any OS. Yes that is my plan, I've got the functions outlined and I'll have them done soon, I have tons of LGM stuff to do.
|
|
« Last Edit: October 04, 2014, 02:19:50 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|