fix: replace drawAnimation by draw

This commit is contained in:
Kazhnuz 2021-08-21 17:05:49 +02:00
parent 7218b7892e
commit c586fb733d
7 changed files with 11 additions and 11 deletions

View file

@ -97,11 +97,11 @@ end
-- DRAW FUNCTIONS -- DRAW FUNCTIONS
-- Draw sprites using these functions -- Draw sprites using these functions
function Sprite:drawAnimation(x, y, r, sx, sy, ox, oy, kx, ky) function Sprite:draw(x, y, r, sx, sy, ox, oy, kx, ky)
self.animator:draw(x, y, r, sx, sy, ox, oy, kx, ky) self.animator:draw(x, y, r, sx, sy, ox, oy, kx, ky)
end end
function Sprite:drawAnimationMask(x, y, r, sx, sy, ox, oy, kx, ky) function Sprite:drawMask(x, y, r, sx, sy, ox, oy, kx, ky)
self.animator:drawMask(x, y, r, sx, sy, ox, oy, kx, ky) self.animator:drawMask(x, y, r, sx, sy, ox, oy, kx, ky)
end end
@ -122,7 +122,7 @@ function Sprite:drawPart(x, y, w, h, r, sx, sy, ox, oy, kx, ky)
end end
love.graphics.setScissor(x - ox, y - oy, w, h) love.graphics.setScissor(x - ox, y - oy, w, h)
self:drawAnimation(x, y, r, sx, sy, ox, oy, kx, ky) self:draw(x, y, r, sx, sy, ox, oy, kx, ky)
love.graphics.setScissor( ) love.graphics.setScissor( )
end end

View file

@ -112,7 +112,7 @@ function Sprite:draw(x, y, r, sx, sy, ox, oy, kx, ky)
if (self.spriteClone ~= nil) then if (self.spriteClone ~= nil) then
self.spriteClone:draw(x, y, r, sx, sy, ox, oy, kx, ky) self.spriteClone:draw(x, y, r, sx, sy, ox, oy, kx, ky)
else else
self.assets.sprites[self.name]:drawAnimation(x, y, r, sx, sy, ox, oy, kx, ky) self.assets.sprites[self.name]:draw(x, y, r, sx, sy, ox, oy, kx, ky)
end end
end end
end end

View file

@ -18,7 +18,7 @@ function Emblem:drawForeground(x, y)
local emblem2 = "m_" .. self.abstract.data.class local emblem2 = "m_" .. self.abstract.data.class
core.screen:setScissor(x, y-16, 32, 40) core.screen:setScissor(x, y-16, 32, 40)
if (self.abstract.hp > 0) then if (self.abstract.hp > 0) then
self.assets.sprites[self.charid]:drawAnimation(x+14, y+14) self.assets.sprites[self.charid]:draw(x+14, y+14)
else else
greyscale.startShader() greyscale.startShader()
self.assets.sprites[self.charid]:drawFrame(1, x+14, y+14) self.assets.sprites[self.charid]:drawFrame(1, x+14, y+14)

View file

@ -200,7 +200,7 @@ function Parent:drawSprite(tx, ty)
if (self.sprite.clone ~= nil) then if (self.sprite.clone ~= nil) then
self.sprite.clone:draw(x + tx, y + ty, 0, sx, sy, self.sprite.ox, self.sprite.oy) self.sprite.clone:draw(x + tx, y + ty, 0, sx, sy, self.sprite.ox, self.sprite.oy)
else else
self.assets.sprites[self.sprite.name]:drawAnimation(x + tx, y + ty, 0, sx, sy, self.sprite.ox, self.sprite.oy) self.assets.sprites[self.sprite.name]:draw(x + tx, y + ty, 0, sx, sy, self.sprite.ox, self.sprite.oy)
end end
end end
end end
@ -285,7 +285,7 @@ function Parent:drawShadow()
local x, y = self.world.map:gridToPixel(self.x, self.y, true) local x, y = self.world.map:gridToPixel(self.x, self.y, true)
self.assets.images["actorsShadow"]:draw(x, y, 0, self.sprite.sx, self.sprite.sy, 12, 5) self.assets.images["actorsShadow"]:draw(x, y, 0, self.sprite.sx, self.sprite.sy, 12, 5)
if (self.isSelected == true) then if (self.isSelected == true) then
self.assets.sprites["cursorground"]:drawAnimation(x - 2, y - 1, 0, 1, 1, 12, 5) self.assets.sprites["cursorground"]:draw(x - 2, y - 1, 0, 1, 1, 12, 5)
end end
end end

View file

@ -54,7 +54,7 @@ end
function CharAnimViewer:draw() function CharAnimViewer:draw()
self.background:draw() self.background:draw()
if (self.sprite ~= nil) then if (self.sprite ~= nil) then
self.sprite:drawAnimation(424/2, 240/1.5) self.sprite:draw(424/2, 240/1.5)
end end
end end

View file

@ -30,7 +30,7 @@ function Encounter:drawCharset(charset, charId)
self.assets.images["shadow"]:draw(x, y + 11) self.assets.images["shadow"]:draw(x, y + 11)
utils.graphics.resetColor() utils.graphics.resetColor()
self.assets.sprites["encounter"]:drawAnimation(x - 1, y + 10) self.assets.sprites["encounter"]:draw(x - 1, y + 10)
end end
return Encounter return Encounter

View file

@ -219,7 +219,7 @@ function PlayerActions:drawActionEffect()
dy = -8 dy = -8
end end
local x, y = self.x + 8 - dx, self.y + 8 - self.z + dy local x, y = self.x + 8 - dx, self.y + 8 - self.z + dy
self.assets.sprites["dash"]:drawAnimation(x, y, math.rad(self.charsetManager.angle[self.charDir])) self.assets.sprites["dash"]:draw(x, y, math.rad(self.charsetManager.angle[self.charDir]))
end end
if (self.currentAction == "punch") then if (self.currentAction == "punch") then
local dx, dy = utils.math.lengthdir(20, math.rad(self.charsetManager.angle[self.charDir])) local dx, dy = utils.math.lengthdir(20, math.rad(self.charsetManager.angle[self.charDir]))
@ -227,7 +227,7 @@ function PlayerActions:drawActionEffect()
dy = 8 dy = 8
end end
local x, y = self.x + 8 - dx, self.y + 8 - self.z + dy local x, y = self.x + 8 - dx, self.y + 8 - self.z + dy
self.assets.sprites["punch"]:drawAnimation(x, y, math.rad(self.charsetManager.angle[self.charDir])) self.assets.sprites["punch"]:draw(x, y, math.rad(self.charsetManager.angle[self.charDir]))
end end
end end