Hi guys,
how I can modify this example to remove the object (sprite) from a scene once tween animation is complete?
myscene.lua:
------------------
local tween = GTween.new(sprite, 10, animate, properties)
--adding event on animaiton complete
tween:addEventListener("complete", function()
stage:removeChild(sprite)
sprite = nil
end)
Basically in my scene I have some special effect that will produce 5-10 sprites and animate them and after 1 second should kill them.
Comments
to remove sprite from any parent just call sprite:removeFromParent()
so you don't care what parent is stage or scene
or I mis interpreted your question?