object.isVisible

Type Boolean
Object DisplayObject
Library display.*
Revision Release 2022.3683
Keywords visibility, object visible, invisible
See also object.alpha

Overview

Controls whether the object is visible on the screen. The property is also readable. The default is true.

Example

local rect1 = display.newRect( 100, 100, 50, 50 )
rect1:setFillColor( 0.7 )

local rect2 = display.newRect( 150, 100, 50, 50 )
rect2:setFillColor( 1, 0, 0, 0.6 )
rect2.isVisible = false