My code:
func _input(event):
if event is InputEventMouseMotion:
print("viewport.size.x: %s" % get_viewport().size.x)
print("viewport.mouse.x: %s" % get_viewport().get_mouse_position().x)
If I play a scene with the mentioned code running, and I move my mouse as far as I can to the right of the game window, this is the console output I get:
viewport.size.x: 2560
viewport.mouse.x: 1919.249878
As you can see, the mouse position doesn't approximate the viewport's apparent size when it's all the way to the right edge of the screen. This is a problem for me, since I want to know how close the mouse is to the right edge of the game screen.
I'm assuming this might have something to do with the font/app scaling in Windows and how Godot calculates viewport mouse position. Also, using get_global_mouse_position().x
has the same problem and gives the same outputs when the ingame camera is placed with it's top left corner at the world origin.