Mouse and input coordinates

    Using hardware coordinates makes sense in the case of writing complex UIs meant to run on PC, such as editors, MMOs, tools, etc. However, it does not make as much sense outside of that scope.

    Godot uses viewports to display content, and viewports can be scaled by several options (see tutorial). Use, then, the functions in nodes to obtain the mouse coordinates and viewport size, for example:

    C#

    Alternatively, it’s possible to ask the viewport for the mouse position:

    C#

    Note