diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-01 10:14:05 +0300 |
---|---|---|
committer | Yuri Roubinsky <chaosus89@gmail.com> | 2021-10-01 10:14:05 +0300 |
commit | 1ade29147b9b9d8dd8f2a1ffdf80ec4f4423a5bd (patch) | |
tree | 82645400a5984e59730fc5bcf2e22e53d5a587f4 | |
parent | df57aa670af563afafd7e38505bb0a939b2042af (diff) |
Add `texture_changed` signal to `Sprite3D`
-rw-r--r-- | doc/classes/Sprite3D.xml | 5 | ||||
-rw-r--r-- | scene/3d/sprite_3d.cpp | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 5a7fd537e0..4ad78429e9 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -36,5 +36,10 @@ Emitted when the [member frame] changes. </description> </signal> + <signal name="texture_changed"> + <description> + Emitted when the [member texture] changes. + </description> + </signal> </signals> </class> diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index b9a2736918..87c2aff4d0 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -625,6 +625,7 @@ void Sprite3D::set_texture(const Ref<Texture2D> &p_texture) { texture->connect(CoreStringNames::get_singleton()->changed, Callable(this, "_queue_update")); } _queue_update(); + emit_signal(SceneStringNames::get_singleton()->texture_changed); } Ref<Texture2D> Sprite3D::get_texture() const { @@ -778,6 +779,7 @@ void Sprite3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::RECT2, "region_rect"), "set_region_rect", "get_region_rect"); ADD_SIGNAL(MethodInfo("frame_changed")); + ADD_SIGNAL(MethodInfo("texture_changed")); } Sprite3D::Sprite3D() { |