From 7c1ab42571d5291952e329554643142a30dee1d1 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 6 Jul 2016 23:46:04 -0300 Subject: Fix the +1 button to insert keyframes in Sprite and Sprite3D, closes #5422 --- scene/2d/sprite.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scene/2d/sprite.cpp') diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp index 27aa08ec5..c5b338bf5 100644 --- a/scene/2d/sprite.cpp +++ b/scene/2d/sprite.cpp @@ -288,6 +288,17 @@ Rect2 Sprite::get_item_rect() const { } + +void Sprite::_validate_property(PropertyInfo& property) const { + + if (property.name=="frame") { + + property.hint=PROPERTY_HINT_SPRITE_FRAME; + + property.hint_string="0,"+itos(vframes*hframes-1)+",1"; + } +} + void Sprite::_bind_methods() { ObjectTypeDB::bind_method(_MD("set_texture","texture:Texture"),&Sprite::set_texture); -- cgit v1.2.3-70-g09d2