- Edited
Mick I just expected the controller to behave the same as the mouse. The mouse can select and click on any button at any time.
In that case disregard the above link. It's relevant for if you want to use the dpad directional buttons to navigate menu buttons or UI elements.
For a emulated mouse cursor you'd have to feed the analog input into a 2D element which could deal with either collision or doing a raycast. But for those to work your buttons would probably also need collision shapes of their own or areas to overlap. There's probably better ways...
There is a warp_mouse()
on control base class that might be useful perhaps? There's also a warp_mouse_position
in the Input class.
then again... InputEventMouseMotion does have a speed property that has a setter... I've never tried it but you could maybe hack it to move the mouse cursor.
and someone has already covered mouse clicking via input event parsing in here:
https://godotengine.org/qa/39531/how-do-i-simulate-a-left-mouse-click-godot-3-1-beta
Note that you can assign a custom icon to the mouse cursor via couple of ways.
TL;DR: You are better off actually controlling the real mouse cursor and events via code using the output of the 'InputEventJoypadMotion' and 'InputEventJoypadButton' than building a custom mouse emulator via Node2D or Control classes.