You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 17:36:07 +00:00
Add converters / generators to Sprite
Adds the following menu options to the Sprite editor: "Convert to Mesh2D", "Convert to Polygon2D", "Create CollisionPolygon2D Sibling" and "Create LightOccluder2D Sibling"
This commit is contained in:
@@ -41,9 +41,14 @@ class SpriteEditor : public Control {
|
||||
GDCLASS(SpriteEditor, Control);
|
||||
|
||||
enum Menu {
|
||||
MENU_OPTION_CREATE_MESH_2D,
|
||||
MENU_OPTION_CONVERT_TO_MESH_2D,
|
||||
MENU_OPTION_CONVERT_TO_POLYGON_2D,
|
||||
MENU_OPTION_CREATE_COLLISION_POLY_2D,
|
||||
MENU_OPTION_CREATE_LIGHT_OCCLUDER_2D
|
||||
};
|
||||
|
||||
Menu selected_menu_item;
|
||||
|
||||
Sprite *node;
|
||||
|
||||
MenuButton *options;
|
||||
@@ -55,7 +60,8 @@ class SpriteEditor : public Control {
|
||||
ConfirmationDialog *debug_uv_dialog;
|
||||
Control *debug_uv;
|
||||
Vector<Vector2> uv_lines;
|
||||
|
||||
Vector<Vector<Vector2> > outline_lines;
|
||||
Vector<Vector<Vector2> > computed_outline_lines;
|
||||
Vector<Vector2> computed_vertices;
|
||||
Vector<Vector2> computed_uv;
|
||||
Vector<int> computed_indices;
|
||||
@@ -71,7 +77,14 @@ class SpriteEditor : public Control {
|
||||
|
||||
void _debug_uv_draw();
|
||||
void _update_mesh_data();
|
||||
void _create_mesh_node();
|
||||
|
||||
void _create_node();
|
||||
void _convert_to_mesh_2d_node();
|
||||
void _convert_to_polygon_2d_node();
|
||||
void _create_collision_polygon_2d_node();
|
||||
void _create_light_occluder_2d_node();
|
||||
|
||||
void _add_as_sibling_or_child(Node2D *p_own_node, Node2D *p_new_node);
|
||||
|
||||
protected:
|
||||
void _node_removed(Node *p_node);
|
||||
|
||||
Reference in New Issue
Block a user