Skip to content

YaDisplayObjectAPI

YaDisplayObjectAPI manages the display of entities.

Functions

void YaDisplayObjectAPI.SetVisibility(YaEntity entity, boolean value)

Determines whether an entity is visible or invisible. Even if an entity is set invisible, its colliders and triggerBox will continue to work.
  • entity Entity
  • value False if entity invisible

boolean YaDisplayObjectAPI.GetVisibility(YaEntity entity)

ReturnsVisible
Returns true if the entity is visible, or false if it's invisible.
  • entity Entity

void YaDisplayObjectAPI.SetColor(YaEntity entity, float3 color)

SERVER ONLY 
Sets the display color of an entity. Only applicable when the entity has the Appearance property.
  • entity entity
  • color color
1
2
-- Prepares the entity & set a red color.
YaDisplayObjectAPI.SetColor(entity, float3.New(1,0,0))

void YaDisplayObjectAPI.SetOpacity(YaEntity entity, number opacity)

SERVER ONLY 
Sets the opacity of the entity. Only applicable when the entity contains both the Appearance and Opacity properties.
  • entity entity
  • opacity opacity
1
2
-- Prepares the entity & set opacity to 0.5.
YaDisplayObjectAPI.SetOpacity(entity , 0.5)

number? YaDisplayObjectAPI.GetOpacity(YaEntity entity)

SERVER ONLY 
ReturnsCurrent opacity of the entity or nil
Returns the current opacity of the entity, or nil if the opacity has never been set.
  • entity Entity

void YaDisplayObjectAPI.SetLightOnOff(YaEntity entity, boolean value)

Determines whether the light is on or off.
  • entity Entity
  • value Value
1
2
-- Prepares the entity & set the light off.
YaDisplayObjectAPI.SetLightOnOff(entity, false)

boolean YaDisplayObjectAPI.GetLightOnOff(YaEntity entity)

ReturnsTrue if the light is on
Returns true if the light is on, or false if the light is off.
  • entity Entity

void YaDisplayObjectAPI.SetLightColor(YaEntity entity, float3 color)

SERVER ONLY 
Set the color of the light.
  • entity Entity
  • color Color (float3)
1
2
-- Prepares the entity & set the light color red.
YaDisplayObjectAPI.SetLightColor(entity, float3.New(1,0,0))

float3? YaDisplayObjectAPI.GetLightColor(YaEntity entity)

SERVER ONLY 
ReturnsColor (float3)
Returns the current color of the light. Returns nil if the light color has never been set.
  • entity Entity