Skip to content
Matías Hermosilla edited this page May 18, 2017 · 21 revisions

The 'Light' Object

Importing

local Light = require("shadows.Light")
local Star = require("shadows.Star")

Functions

Light = Light:new(World World, number Radius)
Light = Star:new(World World, number Radius)

local newWorld = World:new()
local newLight = Light:new(newWorld, 300)
local newStart = Star:new(newWorld, 5000)

Methods

Light:SetAngle(number Angle)
Description: Changes the angle of the light.

number Angle = Light:GetAngle()
Description: Gets the angle of the light.

Light:SetPosition(number x, number y[, number z])
Description: Sets the position of the light, z is a optional height value.

number x, number y, number z = Light:GetPosition()
Description: Gets the position of the light.

Light:SetColor(number R, number G, number B)
Description: Changes the color of the light.

number R, number G, number B = Light:GetColor()
Description: Gets the color of the light.

Light:SetImage(Image Image)
Description: Uses a custom image as light.

Image Image = Light:GetImage()
Description: Gets the custom image of the light.

Light:SetRadius(number Radius)
Description: Changes the radius of the light.

Light:Remove()
Description: Removes the light.

Clone this wiki locally