aboutsummaryrefslogtreecommitdiff
path: root/scene/resources/texture.cpp
diff options
context:
space:
mode:
authorMarianoGNU2016-06-19 22:16:41 -0300
committerMarianoGNU2016-06-20 17:06:19 -0300
commit79c500bee1bb53164a78855419eca8543193f77f (patch)
tree76394a11b51fe1156ea80e94776c488e7b858f02 /scene/resources/texture.cpp
parent38843a67a9fc1411feaa0106b83d499b511aa7c3 (diff)
downloadgodot-79c500bee1bb53164a78855419eca8543193f77f.tar.gz
godot-79c500bee1bb53164a78855419eca8543193f77f.tar.zst
godot-79c500bee1bb53164a78855419eca8543193f77f.zip
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r--scene/resources/texture.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 1893bfe52..2fa00c7da 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -526,8 +526,11 @@ uint32_t AtlasTexture::get_flags() const{
void AtlasTexture::set_atlas(const Ref<Texture>& p_atlas){
+ if (atlas==p_atlas)
+ return;
atlas=p_atlas;
emit_changed();
+ emit_signal("atlas_changed");
}
Ref<Texture> AtlasTexture::get_atlas() const{
@@ -569,6 +572,8 @@ void AtlasTexture::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_margin","margin"),&AtlasTexture::set_margin);
ObjectTypeDB::bind_method(_MD("get_margin"),&AtlasTexture::get_margin);
+ ADD_SIGNAL(MethodInfo("atlas_changed"));
+
ADD_PROPERTY( PropertyInfo( Variant::OBJECT, "atlas", PROPERTY_HINT_RESOURCE_TYPE,"Texture"), _SCS("set_atlas"),_SCS("get_atlas") );
ADD_PROPERTY( PropertyInfo( Variant::RECT2, "region"), _SCS("set_region"),_SCS("get_region") );
ADD_PROPERTY( PropertyInfo( Variant::RECT2, "margin"), _SCS("set_margin"),_SCS("get_margin") );