diff options
author | MarianoGNU <marianognu.easyrpg@gmail.com> | 2016-06-19 22:16:41 -0300 |
---|---|---|
committer | MarianoGNU <marianognu.easyrpg@gmail.com> | 2016-06-20 17:06:19 -0300 |
commit | 79c500bee1bb53164a78855419eca8543193f77f (patch) | |
tree | 76394a11b51fe1156ea80e94776c488e7b858f02 /scene/gui | |
parent | 38843a67a9fc1411feaa0106b83d499b511aa7c3 (diff) |
Modify margins with mouse input
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/patch_9_frame.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/gui/patch_9_frame.cpp b/scene/gui/patch_9_frame.cpp index a6a3490ad2..9ad6398359 100644 --- a/scene/gui/patch_9_frame.cpp +++ b/scene/gui/patch_9_frame.cpp @@ -79,6 +79,8 @@ void Patch9Frame::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_draw_center","draw_center"), & Patch9Frame::set_draw_center ); ObjectTypeDB::bind_method(_MD("get_draw_center"), & Patch9Frame::get_draw_center ); + ADD_SIGNAL(MethodInfo("texture_changed")); + ADD_PROPERTYNZ( PropertyInfo( Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), _SCS("set_texture"),_SCS("get_texture") ); ADD_PROPERTYNO( PropertyInfo( Variant::COLOR, "modulate"), _SCS("set_modulate"),_SCS("get_modulate") ); ADD_PROPERTYNO( PropertyInfo( Variant::BOOL, "draw_center"), _SCS("set_draw_center"),_SCS("get_draw_center") ); @@ -93,11 +95,14 @@ void Patch9Frame::_bind_methods() { void Patch9Frame::set_texture(const Ref<Texture>& p_tex) { + if (texture==p_tex) + return; texture=p_tex; update(); //if (texture.is_valid()) // texture->set_flags(texture->get_flags()&(~Texture::FLAG_REPEAT)); //remove repeat from texture, it looks bad in sprites minimum_size_changed(); + emit_signal("texture_changed"); } Ref<Texture> Patch9Frame::get_texture() const { |