You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Add per-tile flipping and transposing
This commit is contained in:
@@ -48,6 +48,8 @@
|
||||
#include "scene/gui/tab_bar.h"
|
||||
#include "scene/gui/tree.h"
|
||||
|
||||
class TileMapEditor;
|
||||
|
||||
class TileMapSubEditorPlugin : public Object {
|
||||
public:
|
||||
struct TabData {
|
||||
@@ -68,6 +70,14 @@ public:
|
||||
class TileMapEditorTilesPlugin : public TileMapSubEditorPlugin {
|
||||
GDCLASS(TileMapEditorTilesPlugin, TileMapSubEditorPlugin);
|
||||
|
||||
public:
|
||||
enum {
|
||||
TRANSFORM_ROTATE_LEFT,
|
||||
TRANSFORM_ROTATE_RIGHT,
|
||||
TRANSFORM_FLIP_H,
|
||||
TRANSFORM_FLIP_V,
|
||||
};
|
||||
|
||||
private:
|
||||
ObjectID tile_map_id;
|
||||
int tile_map_layer = -1;
|
||||
@@ -89,6 +99,12 @@ private:
|
||||
Button *picker_button = nullptr;
|
||||
Button *erase_button = nullptr;
|
||||
|
||||
HBoxContainer *transform_toolbar = nullptr;
|
||||
Button *transform_button_rotate_left = nullptr;
|
||||
Button *transform_button_rotate_right = nullptr;
|
||||
Button *transform_button_flip_h = nullptr;
|
||||
Button *transform_button_flip_v = nullptr;
|
||||
|
||||
VSeparator *tools_settings_vsep_2 = nullptr;
|
||||
CheckBox *bucket_contiguous_checkbox = nullptr;
|
||||
Button *random_tile_toggle = nullptr;
|
||||
@@ -101,6 +117,7 @@ private:
|
||||
void _on_scattering_spinbox_changed(double p_value);
|
||||
|
||||
void _update_toolbar();
|
||||
void _update_transform_buttons();
|
||||
|
||||
///// Tilemap editing. /////
|
||||
bool has_mouse = false;
|
||||
@@ -129,6 +146,9 @@ private:
|
||||
HashMap<Vector2i, TileMapCell> _draw_bucket_fill(Vector2i p_coords, bool p_contiguous, bool p_erase);
|
||||
void _stop_dragging();
|
||||
|
||||
void _apply_transform(int p_type);
|
||||
int _get_transformed_alternative(int p_alternative_id, int p_transform);
|
||||
|
||||
///// Selection system. /////
|
||||
RBSet<Vector2i> tile_map_selection;
|
||||
Ref<TileMapPattern> tile_map_clipboard;
|
||||
|
||||
Reference in New Issue
Block a user