diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-02-21 10:40:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-21 10:40:43 +0100 |
commit | c291fc39ad6a9e072798311c0ba97c30cc8d24cb (patch) | |
tree | 18e8eff93c90b79ba218de3c6b854f98d14870b0 /scene/resources/tile_set.h | |
parent | ba48417147efef6c17d0e1d1a0f9f11b75c2648e (diff) | |
parent | e69dd475017f91e73a02d8d78114cc9ad2c27f35 (diff) |
Merge pull request #16772 from damarindra/tileset_editor_improvement
Tileset Editor Improvement
Diffstat (limited to 'scene/resources/tile_set.h')
-rw-r--r-- | scene/resources/tile_set.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 1306e2878c..46f34b6252 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -71,6 +71,12 @@ public: BIND_BOTTOMRIGHT = 256 }; + enum TileMode { + SINGLE_TILE, + AUTO_TILE, + ANIMATED_TILE + }; + struct AutotileData { BitmaskMode bitmask_mode; int spacing; @@ -84,6 +90,7 @@ public: // Default size to prevent invalid value explicit AutotileData() : size(64, 64), + spacing(0), icon_coord(0, 0) { bitmask_mode = BITMASK_2X2; } @@ -104,13 +111,13 @@ private: Ref<NavigationPolygon> navigation_polygon; Ref<ShaderMaterial> material; Color modulate; - bool is_autotile; + TileMode tile_mode; AutotileData autotile_data; // Default modulate for back-compat explicit TileData() : - modulate(1, 1, 1), - is_autotile(false) {} + tile_mode(SINGLE_TILE), + modulate(1, 1, 1) {} }; Map<int, TileData> tile_map; @@ -146,8 +153,8 @@ public: void tile_set_region(int p_id, const Rect2 &p_region); Rect2 tile_get_region(int p_id) const; - void tile_set_is_autotile(int p_id, bool p_is_autotile); - bool tile_get_is_autotile(int p_id) const; + void tile_set_tile_mode(int p_id, TileMode p_tile_mode); + TileMode tile_get_tile_mode(int p_id) const; void autotile_set_icon_coordinate(int p_id, Vector2 coord); Vector2 autotile_get_icon_coordinate(int p_id) const; |