57
draw = function (self, x, y)
57
draw = function (self, x, y, map)
58
58
if not self.visible or self.alpha <= 0 then return end
60
60
x = math.floor(x or self.x)
92
92
if self.flipX then scaleX = scaleX * -1 end
93
93
if self.flipY then scaleY = scaleY * -1 end
95
love.graphics.drawq(self._imageObj, self._quad, x + self.width / 2, y + self.height / 2, self.rotation,
96
scaleX, scaleY, self.width / 2, self.height / 2)
96
batches = map.spriteBatches
98
if not batches[self.image] then
99
--batches:addBatch(self.image, self._imageObj)
100
local maph, mapw = map:getMapSize()
101
batches[self.image] = love.graphics.newSpriteBatch(self._imageObj, mapw * maph)
102
print('adding new batch')
105
batches[self.image]:addq(self._quad, x + self.width / 2, y + self.height / 2, self.rotation, scaleX, scaleY, self.width / 2, self.height / 2)
108
love.graphics.drawq(self._imageObj, self._quad, x + self.width / 2, y + self.height / 2, self.rotation,
109
scaleX, scaleY, self.width / 2, self.height / 2)