Skip to content
Matías Hermosilla edited this page Aug 4, 2017 · 1 revision

The 'Shadow' Object

Importing

local CircleShadow = require("shadows.ShadowShapes.CircleShadow")
local PolygonShadow = require("shadows.ShadowShapes.PolygonShadow")

Functions

CircleShadow circleShadow = CircleShadow:new(Body Body, number x, number y, number Radius)
Description: Creates a circle shape.

PolygonShadow polygonShadow = PolygonShadow:new(Body Body, ...)
Description: Creates a polygon shape.

local newWorld = World:new()
local newBody = Body:new(newWorld)
local newCircleShadow = CircleShadow:new(newBody, 0, 0, 64)
local newPolygonhadow = PolygonShadow:new(newBody, 0, 0, 10, 0, 10, 10, 0, 10)

Methods

For 'Shape'

Shape:Remove()
Description: Removes a shape.

For 'CircleShadow'

CircleShadow:SetRadius(number Radius)
Description: Changes the radius of a circle shape.

number Radius = CircleShadow:GetRadius()
Description: Gets the radius of a circle shape.

CircleShadow:SetPosition(number x, number y)
Description: Changes the position of the circle shape.

number x, number y = CircleShadow:GetPosition()
Description: Gets the position of the circle shape.

For 'PolygonShadow'

PolygonShadow:SetVertices(...)
Description: Changes the vertices of the polygon shape.

table Vertices = PolygonShadow:GetVertices()
Description: Gets the vertices of the polygon shape.

Clone this wiki locally