diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2021-05-21 17:28:28 +0200 |
---|---|---|
committer | Gilles Roudière <gilles.roudiere@gmail.com> | 2021-05-25 10:23:57 +0200 |
commit | 78ad206d74d89822d1e1411ad7204c8a3c01efa6 (patch) | |
tree | e72e2722fb3b7b4bf4483385108499bfb1253099 /editor/plugins/tiles/tile_atlas_view.cpp | |
parent | af03e9c83018b47cb82da67e5f8e277b29b82d66 (diff) |
Add TileMap grid editor settings.
Diffstat (limited to 'editor/plugins/tiles/tile_atlas_view.cpp')
-rw-r--r-- | editor/plugins/tiles/tile_atlas_view.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/tiles/tile_atlas_view.cpp b/editor/plugins/tiles/tile_atlas_view.cpp index 6e82951d3d..78f181e321 100644 --- a/editor/plugins/tiles/tile_atlas_view.cpp +++ b/editor/plugins/tiles/tile_atlas_view.cpp @@ -39,6 +39,7 @@ #include "scene/gui/texture_rect.h" #include "editor/editor_scale.h" +#include "editor/editor_settings.h" void TileAtlasView::_gui_input(const Ref<InputEvent> &p_event) { bool ctrl = Input::get_singleton()->is_key_pressed(KEY_CTRL); @@ -316,6 +317,7 @@ void TileAtlasView::_draw_base_tiles_dark() { void TileAtlasView::_draw_base_tiles_shape_grid() { // Draw the shapes. + Color grid_color = EditorSettings::get_singleton()->get("editors/tiles_editor/grid_color"); Vector2i tile_shape_size = tile_set->get_tile_size(); for (int i = 0; i < tile_set_atlas_source->get_tiles_count(); i++) { Vector2i tile_id = tile_set_atlas_source->get_tile_id(i); @@ -324,7 +326,7 @@ void TileAtlasView::_draw_base_tiles_shape_grid() { Vector2 origin = texture_region.position + (texture_region.size - tile_shape_size) / 2 + in_tile_base_offset; // Draw only if the tile shape fits in the texture region - tile_set->draw_tile_shape(base_tiles_shape_grid, Rect2(origin, tile_shape_size), Color(1.0, 0.5, 0.2, 0.8)); + tile_set->draw_tile_shape(base_tiles_shape_grid, Rect2(origin, tile_shape_size), grid_color); } } |