Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Touch Support #204

Merged
merged 71 commits into from
Oct 25, 2018
Merged

Add Touch Support #204

merged 71 commits into from
Oct 25, 2018

Conversation

TheSpydog
Copy link
Member

@TheSpydog TheSpydog commented Oct 22, 2018

This PR implements the Microsoft.Xna.Framework.Input.Touch namespace, as per #2.

Big highlights include:

  • Accuracy fixes for the existing Touch stub
  • Updates to FNAPlatform to detect SDL2 touch events and fetch device capabilities
  • TouchPanel now registers up to 8 touches, which can be accessed via TouchPanel.GetState()
  • Added an internal GestureDetector class whose sole responsibility is (you guessed it!) detecting Gestures
  • All WP7 gestures are supported: Tap, DoubleTap, FreeDrag, HorizontalDrag, VerticalDrag, DragComplete, Flick, Pinch, and PinchComplete -- the gang's all here!
  • Supports Windows desktop, unlike XNA!

After testing extensively with Nick Gravelyn's XNA Gesture Sample, as well as a few other XNA sample games, I believe it works pretty well...at least on my Windows 10 machine! This will definitely need to be tested on different devices (and different touch-enabled OS's if possible).

@TheSpydog TheSpydog changed the title Implemented Input.Touch Add Touch Support Oct 22, 2018
FNA.csproj Outdated Show resolved Hide resolved
@flibitijibibo
Copy link
Member

A whole bunch of comments as seen above, but man does this look nicer than the old Touch stuff. Tomorrow morning I'll give this a shot and provide feedback.

This is a total shot in the dark, but @nickgravelyn, if you have a PC with touch support, would you be up for trying this out to see how it feels? @TheSpydog has a prepared FNA sample to make testing this easier (can you post that for us, Caleb?).

@ghost
Copy link

ghost commented Oct 22, 2018

I do not have a PC with touch support, I'm afraid.

@flibitijibibo
Copy link
Member

flibitijibibo commented Oct 22, 2018

Well, shoot - would have been cool to bring XNA Touch support full circle like that!

Another person that will need to see this is @0x0ade. Maik, see if Caleb's FNA sample works with FNADroid - functionally it seems to be the same as far as event handling goes, so I'm hoping this should be okay right off the bat.

@TheSpydog
Copy link
Member Author

All right, fixed everything you mentioned and uploaded the Gesture Sample project for anyone who wants to take this for a spin.

@flibitijibibo
Copy link
Member

Well, this has certainly passed my test:

https://twitter.com/flibitijibibo/status/1054522305118904320

@0x0ade, if you think you'll have time within the week to play with this let me know, otherwise I'll do one last scan and merge this in. The binaries in the sample should load up without any fuss, I hope.

@0x0ade
Copy link
Contributor

0x0ade commented Oct 23, 2018

I'll have some time to test this on Android either tomorrow or on Thursday.

@flibitijibibo flibitijibibo merged commit fe0fe54 into FNA-XNA:master Oct 25, 2018
@TheSpydog TheSpydog deleted the touch branch November 5, 2018 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants