Skip to content
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

Document the valid range of tile coordinates in TileMapLayer #102776

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

timothyqiu
Copy link
Member

As mentioned in RocketChat, TileMapLayer converts cell coordinates to 16-bit when serializing data.

// Store position in TileMap.
encode_uint16((int16_t)(E.key.x), &cell_data_ptr[0]);
encode_uint16((int16_t)(E.key.y), &cell_data_ptr[2]);

This behavior dates back to the Godot Is Open Source commit :) Although it is quite rare to use extremely large tile maps, it is perfectly valid for users to create one in the editor. However, the result of doing so may be unexpected.

So I think it's better to document it and acknowledge it as intended rather than as a bug.

@Repiteo Repiteo added this to the 4.4 milestone Feb 12, 2025
@Repiteo Repiteo merged commit be7b640 into godotengine:master Feb 12, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 12, 2025

Thanks!

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

Successfully merging this pull request may close these issues.

4 participants