mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
added glow map support to animations
This commit is contained in:
parent
2282d9ea33
commit
9911d02fd4
12
lib/body.lua
12
lib/body.lua
@ -534,22 +534,20 @@ function body:drawGlow()
|
||||
love.graphics.rectangle("fill", self.x, self.y, self.width, self.height)
|
||||
elseif self.type == "polygon" then
|
||||
love.graphics.polygon("fill", unpack(self.data))
|
||||
elseif self.type == "image" and self.img then
|
||||
elseif (self.type == "image" or self.type == "animation") and self.img then
|
||||
if self.glowStrength > 0.0 and self.glow then
|
||||
love.graphics.setShader(self.glowShader)
|
||||
self.glowShader:send("glowImage", self.glow)
|
||||
self.glowShader:send("glowTime", love.timer.getTime() * 0.5)
|
||||
love.graphics.setColor(255, 255, 255)
|
||||
else
|
||||
love.graphics.setShader()
|
||||
love.graphics.setColor(0, 0, 0)
|
||||
end
|
||||
love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy)
|
||||
elseif self.type == "animation" then
|
||||
if self.glow then
|
||||
print('glowmaps not yet supported for animations')
|
||||
end
|
||||
if self.type == "animation" then
|
||||
self.animation:draw(self.img, self.x - self.ix, self.y - self.iy)
|
||||
else
|
||||
love.graphics.draw(self.img, self.x - self.ix, self.y - self.iy)
|
||||
end
|
||||
end
|
||||
|
||||
love.graphics.setShader()
|
||||
|
Loading…
Reference in New Issue
Block a user