Skip to content

Conversation

@Hex-4
Copy link
Contributor

@Hex-4 Hex-4 commented Oct 4, 2023

closes #8074

Tiny PR that updates the syntax on the mouse and input coordinates page.

@Hex-4 Hex-4 force-pushed the fix-mouse-and-input-coords-page branch from 51a97a4 to a5811a2 Compare October 5, 2023 23:10
@mhilbrunner mhilbrunner added bug area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.0 cherrypick:4.1 topic:input labels Oct 6, 2023
@mhilbrunner mhilbrunner merged commit fd94ebf into godotengine:master Oct 6, 2023
@mhilbrunner
Copy link
Member

Tiny PR but fixes people running into outdated, non-working code. Great! :) Merged. Thanks Sauermann for the review, and thanks Hex-4 for oncorporating it so quickly and squashing. Nice!


# 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.


// 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());

@Hex-4
Copy link
Contributor Author

Hex-4 commented Oct 7, 2023

Looks like there are a few changes I should make - do I need to make a new PR or can I just amend another commit to this one?

@Sauermann
Copy link
Contributor

You can amend PRs only before they are merged. So creating a new PR is the only viable option.

@Hex-4 Hex-4 deleted the fix-mouse-and-input-coords-page branch October 7, 2023 18:54
@mhilbrunner
Copy link
Member

Cherry-picked to 4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug cherrypick:4.0 topic:input

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out of date: Mouse and input coordinates page

4 participants