GUIManager for Windows Phone?

Jul 3, 2011 at 6:34 AM

Awesome library! I'm trying to create a HUD in an XNA windows phone game. I setup a screen, etc, per this explanation:

http://nuclexframework.codeplex.com/wikipage?title=Nuclex.UserInterface&referringTitle=Documentation

One thing that didn't work was the GuiManager constructor call -- needed to pass this.Services, not this. And then I had to add an input manager to that service collection. I used, as the excellent exception message suggested, the default InputManager implementation.

So after that, I got a button to render correctly, but tapping it doesn't do anything, I'm guessing because it's a touch interface not a mouse. I couldn't find anything that says whether this library is supposed to work for WP7. Does it? :) And if so, what am I doing wrong? 

Coordinator
Jul 5, 2011 at 8:38 AM

The GUI currently does not understand touch panel input. I'm not really doing anything with Windows Phone myself, so this stuff is taking a bit longer to complete, sorry :)

You can make it work by translating touch panel events into mouse events. The GUI uses an IInputCapturer to obtain input, so by wrapping that class and calling this.inputReceiver.InjectMousePress/InjectMouseMove/InjectMouseRelease in responds to the appropriate touch events, you can make the GUI believe it's being driven by a mouse.

For an example of an input capturer, look at Nuclex.UserInterface\Source\Input\DefaultInputCapturer.cs. It uses Nuclex.Input (which already supports touch input) to subscribe to various events (KeyPressed, MouseMoved and so on) that it then forwards to its IInputReceiver.

Jul 5, 2011 at 6:19 PM

Ah, makes sense :) thanks for the info and keep up the awesome work.

Oct 4, 2011 at 10:00 PM

infinitiesloop, if you already develop this, you can share the code, cant you? I'm trying to do the same thing (and other developers surely).

I didnt code anything yet, but i'm thinking in it...

Greetings from Argentina

Oct 4, 2011 at 10:06 PM

I'd share if I had anything, sorry. I was just playing around with this framework to see how far I could get with it on WP7. Based on this thread I stopped using it, but that project is on hold and I haven't touched it in months.