SetColor

This function sets an entity's color.

Syntax

Parameters

Returns

If the entity is hidden, true is returned, otherwise false is returned.

Example

--Create a window
window = Window:Create()
context = Context:Create(window)
world = World:Create()
local camera = Camera:Create()
camera:SetRotation(35,0,0)
camera:Move(0,0,-6)
local light = DirectionalLight:Create()
light:SetRotation(35,35,0)

--Create the ground
local ground = Model:Box(10,1,10)
ground:SetPosition(0,0,-0.5)
ground:SetColor(0,1,0)

--Create a shape
local shape = Shape:Box(0,0,0, 0,0,0, 10,1,10)
ground:SetShape(shape)
shape:Release()

--Create a box
local box = Model:Box(1,1,1)
box:SetPosition(0,5,0)
box:SetColor(0,0,1)
box:SetMass(1)

--Create a shape
local shape = Shape:Box(0,0,0, 0,0,0, 1,1,1)
box:SetShape(shape)
shape:Release()

while true do
if window:Closed() or window:KeyHit(Key.Escape) then return false end

Time:Update()
world:Update()
world:Render()
context:Sync()
end