-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
Rename TileMap/GridMap.world_to_map
and opposite to local_to_map
#64661
Conversation
ea6cdf7
to
66823a9
Compare
85d31af
to
ecaccb4
Compare
737bd56
to
e9a9338
Compare
Am a dummy. This is off-topic, but this conversion logic could use some type checking. I was thinking back to #64377 and how hard it would be to properly recognise and convert due of how vague the original name is... |
I think the conversion is still missing for the tilemap's functions though. Since it works with |
Indeed, it is missing. That's because unfortunately the conversion tool currently has no way to tell what Class the renamed method is associated to, so it looks like it'll convert every method name regardless of context. If I had the time to concoct... basically a rework of the entire process I would've certainly done it, but actually detecting from what class type the method is from (accounting for user-defined methods too), with or without optional typing/type inference, looks to be insurmountable in my eyes. Certainly possible, but not nearly as simple as a String replacement. |
e9a9338
to
4100224
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
655dfe5
to
c135f81
Compare
For both TileMap and GridMap: - `world_to_map` -> `local_to_map` - `map_to_world` -> `map_to_local` Also changes any mention of "world" in this context to "local" to avoid future confusion. Finally, updates the docs of both methods for consistency. In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
c135f81
to
694190a
Compare
Rebased, and actually fixed the faulty |
Actually might need double checking by @groud, I assumed the above but Yuri tells me this was still be discussed on chat yesterday. Edit: Confirmed good to merge by groud. |
Thanks! |
(Partially) closes godotengine/godot-proposals#4535.
For both TileMap and GridMap:
world_to_map
->local_to_map
map_to_world
->map_to_local
(This screenshot may not accurately represent the description in the PR)
![Showcase](https://user-images.githubusercontent.com/66727710/185757654-12805f83-cf18-4018-a040-eff10bf5fd4f.png)
Also changes any mention of "world" in this context to "local" to avoid future confusion.
Finally, updates the Documentation of both methods for consistency.
In particular, adding a note on how to convert the returned values from local to global coordinates and vice versa.
Very glad of this one. I use this method frequently and I want more people to properly understand what it does.