setObjectVisibility()
Purpose
Used to set the visibility of an object in 3D space
Syntax
setObjectVisibility( object, visibility )
Arguments
object Handle which stores the object
visibility Integer visibility setting (true/1) - visibile (false/0) - invisible
Example
c = controls(0)
oldc = c
ink(navy)
obj = placeObject( cube, { 0, 0, 0 }, { 2, 2, 2 } )
setObjectMaterial( obj, bisque, 0, 1 )
setEnvironment( 3, { .2, .2, .2, 1 } )
visible = true
loop
clear()
c = controls(0)
if c.a and !oldc.a then
visible = !visible
setObjectVisibility( obj, visible )
endif
rotateObject( obj, { 0, 1, 1 }, 1 )
drawObjects()
oldc = c
printAt(0, 0, "Press the A button to change object visibility setting")
printAt(0, 2, "Object visibility: ", visible)
update()
repeat
Associated Commands
drawObjects(), placeObject(), rotateObject(), setObjectMaterial()