-
Notifications
You must be signed in to change notification settings - Fork 20
Light World
local LightWorld = require 'lib' --the directory you've placed the files in (in this repo it's "lib")
local lightWorld = LightWorld({
-- options here
})
Available Options
- ambient - required the color of the darkness
- refractionStrength - how strong the world refraction is
- reflectionStrength - how strong reflection is
- reflectionVisibility - how visible the reflections are
- shadowblur - the amount the shadows are blurred (this makes them seem a bit more natural)
- glowBlur - the amount that glowing object lights are blurred
defaults: (love.graphics.getWidth(), love.graphics.getHeight())
used for refreshing canvas sizes, this will cascade over the lights and bodies and is very costly so only call this when the screen has been resized.
defaults: (0,0,1)
The main draw method to be called in love.draw()
returns Light
Creates a new light at position (x, y) with color (red, green, blue) with a shine radius of (range)
Clears all lights from the world
Clears all shadow bodies from the world
Clears all shadows and bodies from the world
Sets the callback for drawing the foreground
returns Body
new rectangle shadowbody with centre at x,y with dimensions w,h
returns Body
new circle shadowbody with the centre at x,y and a radius of r
returns Body
new shadowbody polygon with the points provided (3 < n < 9)
defaults: width=image_width, height=image_height, ox=0, oy=0
returns Body
new shadowbody from an image at point x,y with size of width,height and an offset point of ox,oy
returns Body
new shadowbody from an image at point x,y this will not yet draw though if you dont add an animation to it.
returns Body
new refraction shadow body at point x,y with the size of width,height
returns Body
new refraction made from a height map that has been converted into a normal map
returns Body
new reflection shadow body at point x,y with the size of width,height
returns Body
new reflection made from a height map that has been converted into a normal map
returns number
get number of bodies
returns Body
get body number n
returns number get number of lights
returns Light
Get light number n
returns bool true if succeeded false if not
remove the item from the light world, you can pass in either a light or a shadow body.