| Quo Vadis, Input System? |
|
|
| Written by Markus Ewald | |||
| Tuesday, August 17 2010 18:08 | |||
|
I've spent some time thinking about how input is handled by my GUI library. One issue I didn't cover in its initial design is that people might want to use the GUI library at the same time as their game is running (think of a command palette in a strategy game). I've already got some requests on the CodePlex forums (How to determine if a screen-position (i.e. mouseclick) is on any gui-control ? and Unfocusing from GUI) and it's about time I did something about this.
In the old design, an
This wasn't even nearly an ideal solution because now I would have
to copy & paste the game pad polling code from the
As a first step, I turned the
It's a chat pad and it can be attached to an XBox 360 controller,
meaning it can be connected to the PC as well and needs to be
polled via the XNA So as an intermediate design step, the trunk build of my Nuclex Framework now uses this improved design:
Before I begin modifying the GUI input response code to make it easier for the GUI to coexist with gameplay running at the same time, there remain two things to solve:
I'm even thinking whether it makes sense to pull all that input handling stuff out of the Nuclex.UserInterface library and put it into a separate library (Nuclex.Input or so). This would allow me to provide event-based input, perhaps even a multi-threaded polling solution at a later date, together with support for standard joysticks and game pads for XNA. John Sedlak had something similar in his XNA5D library (I think it's now been renamed to "Focused Games Framework") and I remember it being used successfully by some developers. Haven't tried it myself so far because I wasn't sold on the design (I hate message objects being passed around with a passion :D). The idea is sound and useful, though! Expect some goodness soon! As always, feedback is very welcome ;-)
|

