Tilemap fix displaced textures and shapes and added center texture and compatibility mode
This commit fix #22989 #15249 #28206. Main problem is that tilemap displace textures in different tile origins in a strange way and doesn´t respect coincidence between texture and shapes in not uniform tiles. This issue is present in godot 3.0 and godot 3.1. To maintain compatibility are added a compatibility mode and a center texture option. Other related issues and pull request: #28896 #29487 #29519 #29961. Idications of #30204 are added
This commit is contained in:
parent
d40dbd6d11
commit
14e2a99129
4 changed files with 207 additions and 22 deletions
|
|
@ -181,6 +181,8 @@ private:
|
|||
bool used_size_cache_dirty;
|
||||
bool quadrant_order_dirty;
|
||||
bool y_sort_mode;
|
||||
bool compatibility_mode;
|
||||
bool centered_textures;
|
||||
bool clip_uv;
|
||||
float fp_adjust;
|
||||
float friction;
|
||||
|
|
@ -311,6 +313,12 @@ public:
|
|||
void set_y_sort_mode(bool p_enable);
|
||||
bool is_y_sort_mode_enabled() const;
|
||||
|
||||
void set_compatibility_mode(bool p_enable);
|
||||
bool is_compatibility_mode_enabled() const;
|
||||
|
||||
void set_centered_textures(bool p_enable);
|
||||
bool is_centered_textures_enabled() const;
|
||||
|
||||
Array get_used_cells() const;
|
||||
Array get_used_cells_by_id(int p_id) const;
|
||||
Rect2 get_used_rect(); // Not const because of cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue