krampster
Topic Author
Posts: 2
Joined: 02 May 2014, 01:05

Override input?

02 May 2014, 01:07

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?
 
User avatar
jsantos
Site Admin
Posts: 2906
Joined: 20 Jan 2012, 17:18
Contact:

Re: Override input?

02 May 2014, 17:04

Hi!

Not sure to understand you. Do you want to change the mouse cursor image? In that case, yes it can be done.
 
krampster
Topic Author
Posts: 2
Joined: 02 May 2014, 01:05

Re: Override input?

02 May 2014, 18:18

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.
 
User avatar
sfernandez
Site Admin
Posts: 1918
Joined: 22 Dec 2011, 19:20

Re: Override input?

02 May 2014, 19:37

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.

Who is online

Users browsing this forum: No registered users and 1 guest