How to get input position relative to viewport??

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abdullahzubair109
:warning: Old Version Published before Godot 3 was released.

My display monitor’s resolution is 1920 * 1080. If i lower my resolution to 1600 * 900, and set viewport size as 1600 * 900, still get_viewport().get_mouse_position shows mouse position beyond 1600 and 900… still it shows upto 1920 and 1080. How to calculate input position, relative to the current game screen size?

what is your Strectch Mode at Project Settings > Display?

volzhs | 2017-12-26 16:05