diff --git a/README.md b/README.md index 9658786..9b00577 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ local LightWorld = require "lib/light_world" -- create light world lightWorld = LightWorld({ drawBackground = drawBackground, --the callback to use for drawing the background - drawForground = drawForground, --the callback to use for drawing the foreground + drawForeground = drawForeground, --the callback to use for drawing the foreground ambient = {55,55,55}, --the general ambient light in the environment }) diff --git a/examples/complex.lua b/examples/complex.lua index 90e356d..13dbca3 100644 --- a/examples/complex.lua +++ b/examples/complex.lua @@ -94,7 +94,7 @@ function love.load() refractionStrength = 16.0, reflectionVisibility = 0.75, drawBackground = drawBackground, - drawForground = drawForground + drawForeground = drawForeground }) mouseLight = lightWorld:newLight(0, 0, 255, 191, 127, lightRange) @@ -357,7 +357,7 @@ function drawBackground(l,t,w,h) end end -function drawForground(l,t,w,h) +function drawForeground(l,t,w,h) love.graphics.setBlendMode("alpha") for i = 1, phyCnt do if phyLight[i]:getType() == "polygon" then diff --git a/examples/normalMap.lua b/examples/normalMap.lua index 6d249a6..050bcf6 100644 --- a/examples/normalMap.lua +++ b/examples/normalMap.lua @@ -12,7 +12,7 @@ function love.load() -- create light world lightWorld = LightWorld({ drawBackground = drawBackground, - drawForground = drawForground, + drawForeground = drawForeground, ambient = {55,55,55}, refractionStrength = 32.0, reflectionVisibility = 0.75, @@ -65,7 +65,7 @@ function drawBackground(l,t,w,h) love.graphics.rectangle("fill", -l/scale, -t/scale, w/scale, h/scale) end -function drawForground(l,t,w,h) +function drawForeground(l,t,w,h) love.graphics.setColor(255, 255, 255) local w, h = love.graphics.getWidth(), love.graphics.getHeight() love.graphics.draw(image, w/2-(image:getWidth()/2), h/2-(image:getHeight()/2)) diff --git a/examples/short.lua b/examples/short.lua index 9e3ad8d..111da1b 100644 --- a/examples/short.lua +++ b/examples/short.lua @@ -16,7 +16,7 @@ function love.load() -- create light world lightWorld = LightWorld({ drawBackground = drawBackground, - drawForground = drawForground, + drawForeground = drawForeground, ambient = {55,55,55}, refractionStrength = 32.0, reflectionVisibility = 0.75, @@ -132,7 +132,7 @@ function drawBackground(l,t,w,h) love.graphics.rectangle("fill", -l/scale, -t/scale, w/scale, h/scale) end -function drawForground(l,t,w,h) +function drawForeground(l,t,w,h) love.graphics.setColor(63, 255, 127) local cx, cy = circleTest:getPosition() love.graphics.circle("fill", cx, cy, circleTest:getRadius()) diff --git a/lib/init.lua b/lib/init.lua index 1fb4cd5..d8a4f32 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -58,7 +58,7 @@ function light_world:init(options) self.glowDown = false self.drawBackground = function() end - self.drawForground = function() end + self.drawForeground = function() end options = options or {} for k, v in pairs(options) do self[k] = v end @@ -102,7 +102,7 @@ function light_world:draw(l,t,s) util.drawto(self.render_buffer, l, t, s, function() self.drawBackground( l,t,w,h,s) self:drawShadow( l,t,w,h,s) - self.drawForground( l,t,w,h,s) + self.drawForeground( l,t,w,h,s) self:drawMaterial( l,t,w,h,s) self:drawShine( l,t,w,h,s) self:drawPixelShadow(l,t,w,h,s) @@ -280,7 +280,7 @@ end function light_world:clear() light_world:clearLights() - light_world:clearBodys() + light_world:clearBodies() end -- clear lights @@ -290,7 +290,7 @@ function light_world:clearLights() end -- clear objects -function light_world:clearBodys() +function light_world:clearBodies() self.body = {} self.isShadows = false self.isRefraction = false @@ -302,7 +302,7 @@ function light_world:setBackgroundMethod(fn) end function light_world:setForegroundMethod(fn) - self.drawForground = fn or function() end + self.drawForeground = fn or function() end end -- set ambient color diff --git a/main.lua b/main.lua index 701c400..a5bca16 100644 --- a/main.lua +++ b/main.lua @@ -77,7 +77,7 @@ function exf.drawBackground() exf.list:draw() end -function exf.drawForground() +function exf.drawForeground() love.graphics.setColor(255, 255, 255) love.graphics.draw(exf.bigball, 800 - 128, 600 - 128, love.timer.getTime(), 1, 1, exf.bigball:getWidth() * 0.5, exf.bigball:getHeight() * 0.5) end @@ -184,7 +184,7 @@ function exf.resume() -- create light world lightWorld = LightWorld({ drawBackground = exf.drawBackground, - drawForground = exf.drawForground + drawForeground = exf.drawForeground }) lightWorld:setAmbientColor(127, 127, 127)