Not entirely sure what you're trying to accomplish with the resize method; from my understanding, Godot handles scaling automatically, the only thing I think you have to deal with is the mouse coordinates and you can get the re-projected/scaled value. I also had some issues with ViewPorts skewing inputs locations, solution was to use get_global_mouse_position()
and direct_space_state
for intersections, as here:
func _unhandled_input(event):
if event.is_action_pressed('click_left'):
#print(str("get_global_mouse_position() = ", get_global_mouse_position()))
left_click_position = get_global_mouse_position();
func _physics_process(delta):
if left_click_position != null:
var space_state = get_world_2d().direct_space_state;
var intersections = space_state.intersect_point(left_click_position);
#print(str("Main intersections: >>>>> ", intersections.size(), " <<<<< intersections"));
if intersections == null || intersections.size() == 0:
player.move(left_click_position);
else:
if intersections[0].collider is Character:
character_selected(intersections[0].collider);
left_click_position = null;
Maybe something similar would work for you? That said; I think I might have to use that resize method later on in my project; as I'd also like it to scale up pixel perfect; as is, it sees to use some AA which just blurs everything...