Page 1 of 1

Override input?

Posted: 02 May 2014, 01:07
by krampster
Considering using your framework...
Is there a way to override input so that I could do something like use a 1st person shooter's crosshair as if it were the mouse?

Re: Override input?

Posted: 02 May 2014, 17:04
by jsantos
Hi!

Not sure to understand you. Do you want to change the mouse cursor image? In that case, yes it can be done.

Re: Override input?

Posted: 02 May 2014, 18:18
by krampster
Sorry for being a little vague.
I want to have a XAML UI rendered to a texture in game, but I want to provide my own mouse coordinates, so that for example in a first person shooter, the player could aim at and shoot a button. There is no cursor except the crosshair, which is fixed. I'm sure I could figure out the visuals, I'm interested in rewiring the input.

Re: Override input?

Posted: 02 May 2014, 19:37
by sfernandez
Hi krampster,

If you take a look at Plugins/NoesisGUI/Scripts/Core/NoesisUIRenderer.cs, that class is the one in charge of translating input events to NoesisGUI keyboard/mouse/touch events.

You can disable default input management by unchecking the "Enable Keyboard/Mouse/Touch" toggles in NoesisGUIPanel component.

Then you can make public the Noesis_MouseMove, Noesis_MouseDown, Noesis_MouseUp methods, to call them from the scripts where you calculate the crosshair-texture ray intersection.

If you need a deeper explanation I can help.