Hidden

This function can be used to tell if an entity is hidden.

Syntax

Returns

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

Example

entity = {}

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

model = Model:Box()
model:SetColor(0.0,0.0,1.0)

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

model:Turn(0,Time:GetSpeed(),0)

if (window:KeyHit(Key.Space)) then

if (model:Hidden()) then
model:Show()
else
model:Hide()
end
end

Time:Update()
world:Update()
world:Render()

context:SetBlendMode(Blend.Alpha)
context:DrawText("Press space to change.",2,2)
context:DrawText("Hidden:"..tostring(model:Hidden()),2,22)

context:Sync()
end