Hey, I was looking for any info about input handling system and how it was implemented in your engine, specifically for SmartPhones (iOS), but found only non native Gesture and Touch types and also Surface. I was expecting to see some Raw Input Mapper, Input Contexts, Actions and maybe States. Also, do you use polling or event based input reading? Also, did you consider to use SwiftUI or UIKit Gesture types?
That's a fun game!
Hey
Input uses a combination of polling and events. Gamepads are polled on demand and keyboard, mouse, and touch are populated by system events. But these are implication details that donât matter to your project.
The input API is a standardized meta accumulation of system inputs. You do not currently have access to raw input data.
Within your System subclass youâll have access to input: HID
as an argument of the update()
function which allows access to all inputs.
I may make raw data available at some point, but making sure inputs are consistent on every platform is more important at this stage.
Touch is currently available only as individual touches. Gestures are important and will be available at some point but I need to finish the Android support first so I can ensure itâs designed in a way that keeps mobile platforms consistent.
Im also considering a UI API that will support scrolling, zooming, panning, etc⊠and that will influence the design of gestures.
For right now though you do need to create your own solution for gestures.
There is an example of how inputs are used available here: