chore(gfx): port gfx actors to the new system
This commit is contained in:
parent
791bf8754e
commit
ca3bf9ea7e
2 changed files with 6 additions and 16 deletions
|
@ -31,16 +31,11 @@ function GFX:new(world, x, y, spritename)
|
||||||
GFX.super.new(self, world, "gfx", x - (width/2), y - (height/2), width, height)
|
GFX.super.new(self, world, "gfx", x - (width/2), y - (height/2), width, height)
|
||||||
self:setSprite(spritename)
|
self:setSprite(spritename)
|
||||||
self:cloneSprite()
|
self:cloneSprite()
|
||||||
|
|
||||||
local duration = self.sprite.clone:getAnimationDuration()
|
|
||||||
self:addTimer("destroy", duration)
|
|
||||||
self.depth = -100
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GFX:timerResponse(name)
|
function GFX:animationEnded(animation)
|
||||||
if (name == "destroy") then
|
core.debug:print("gfx2D", 'Current animation "' .. animation .. '" have ended, destroying gfx')
|
||||||
self:destroy()
|
self:destroy()
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return GFX
|
return GFX
|
||||||
|
|
|
@ -31,16 +31,11 @@ function GFX:new(world, x, y, z, spritename)
|
||||||
GFX.super.new(self, world, "gfx", x - (width/2), y - (width/2), z - (height/2), width, width, height)
|
GFX.super.new(self, world, "gfx", x - (width/2), y - (width/2), z - (height/2), width, width, height)
|
||||||
self:setSprite(spritename)
|
self:setSprite(spritename)
|
||||||
self:cloneSprite()
|
self:cloneSprite()
|
||||||
|
|
||||||
local duration = self.sprite.clone:getAnimationDuration()
|
|
||||||
self:addTimer("destroy", duration)
|
|
||||||
self.depth = -100
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function GFX:timerResponse(name)
|
function GFX:animationEnded(animation)
|
||||||
if (name == "destroy") then
|
core.debug:print("gfx3D", 'Current animation "' .. animation .. '" have ended, destroying gfx')
|
||||||
self:destroy()
|
self:destroy()
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
return GFX
|
return GFX
|
||||||
|
|
Loading…
Reference in a new issue