Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tutorials/inputs/mouse_and_input_coordinates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ for example:
print("Mouse Motion at: ", event.position)

# Print the size of the viewport.
print("Viewport Resolution is: ", get_viewport_rect().size)
print("Viewport Resolution is: ", get_viewport().get_visible_rect())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it looks like I missed size in my suggestion.
It should rather be get_viewport().get_visible_rect().size.


.. code-tab:: csharp

Expand All @@ -49,7 +49,7 @@ for example:
GD.Print("Mouse Motion at: ", eventMouseMotion.Position);

// Print the size of the viewport.
GD.Print("Viewport Resolution is: ", GetViewportRect().Size);
GD.Print("Viewport Resolution is: ", GetViewportRect().GetVisibleRect());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The C# example doesn't match the GDScript example.

Suggested change
GD.Print("Viewport Resolution is: ", GetViewportRect().GetVisibleRect());
GD.Print("Viewport Resolution is: ", GetViewport().GetVisibleRect());

}

Alternatively, it's possible to ask the viewport for the mouse position:
Expand Down