Skip to content

Improve Lesson 22 cell screen-position explanation #655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 9, 2022
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
9 changes: 7 additions & 2 deletions course/lesson-22-functions-return-values/lesson.tres
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ In previous lessons, we had characters walking on grids.

And for those practices, you were working directly with cell coordinates.

Well, cell coordinates don't correspond to positions on the screen, so we need to convert cell positions to screen positions."
Well, cell coordinates don't correspond to positions on the screen. To find the center of any cell on the screen, we need to convert the cell's coordinates to a position on the screen, in pixels."
visual_element_path = ""
reverse_blocks = false
has_separator = false
Expand All @@ -174,7 +174,12 @@ script = ExtResource( 4 )
content_id = "res://course/lesson-22-functions-return-values/content-BWNbDGt6.tres"
title = ""
type = 0
text = "To do so, we use a function. It multiplies the cell coordinate by the cell size, adds half the cell size to the product, and returns the result."
text = "To do so, we use a function. The function does two things:

1. First, it multiplies the cell coordinates by the cell size, which gives us the position of the cell's top-left corner on the screen, in pixels.
2. Then, we add half of the cell size to get the center of the cell.

The function returns the result, allowing us to store it in a variable."
visual_element_path = ""
reverse_blocks = false
has_separator = false
Expand Down