diff options
author | Danil Alexeev <danil@alexeev.xyz> | 2022-09-21 16:01:43 +0300 |
---|---|---|
committer | Danil Alexeev <danil@alexeev.xyz> | 2022-09-21 16:07:47 +0300 |
commit | df2209c7001ae4fc524b9207916dbc828fc7bca5 (patch) | |
tree | 95efb21b0daea055e21d1d4999b64e6649f0c65b /scene/2d/collision_shape_2d.h | |
parent | 74765691cb4b5989df73d48acf547d120aa46779 (diff) |
Add `CollisionShape2D.debug_color` property
Diffstat (limited to 'scene/2d/collision_shape_2d.h')
-rw-r--r-- | scene/2d/collision_shape_2d.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/2d/collision_shape_2d.h b/scene/2d/collision_shape_2d.h index 5e50420e00..b0b8a7cb0f 100644 --- a/scene/2d/collision_shape_2d.h +++ b/scene/2d/collision_shape_2d.h @@ -42,15 +42,20 @@ class CollisionShape2D : public Node2D { Rect2 rect = Rect2(-Point2(10, 10), Point2(20, 20)); uint32_t owner_id = 0; CollisionObject2D *parent = nullptr; - void _shape_changed(); bool disabled = false; bool one_way_collision = false; real_t one_way_collision_margin = 1.0; + Color debug_color; + void _shape_changed(); void _update_in_shape_owner(bool p_xform_only = false); + Color _get_default_debug_color() const; protected: void _notification(int p_what); + bool _property_can_revert(const StringName &p_name) const; + bool _property_get_revert(const StringName &p_name, Variant &r_property) const; + void _validate_property(PropertyInfo &p_property) const; static void _bind_methods(); public: @@ -72,6 +77,9 @@ public: void set_one_way_collision_margin(real_t p_margin); real_t get_one_way_collision_margin() const; + void set_debug_color(const Color &p_color); + Color get_debug_color() const; + PackedStringArray get_configuration_warnings() const override; CollisionShape2D(); |