Module LightUnit

Emits a source of light

Element class: LightUnit

Extends: Element > ElementWithState > ElementWithToggle

Functions

activate () Switches the light on.
deactivate () Switches the light off.
isActive () Checks if the light is on.
setRGBColor (r, g, b) Deprecated: Set the light color in RGB.
setColor (r, g, b) Set the color of the light to RGB.
getRGBColor () Deprecated: Get the light color in RGB.
getColor () Returns the light color in RGB.
setBlinkingState (state) Enables or disables the blinking state of the light.
isBlinking () Checks if the light blinking is enabled.
getOnBlinkingDuration () Returns the light 'on' blinking duration.
setOnBlinkingDuration (time) Set the light 'on' blinking duration.
getOffBlinkingDuration () Returns the light 'off' blinking duration.
setOffBlinkingDuration (time) Set the light 'off' blinking duration.
getBlinkingTimeShift () Returns the light blinking time shift.
setBlinkingTimeShift (shift) Set the light blinking time shift.
setSignalIn (plug, state) Set the value of a signal in the specified IN plug of the element.
getSignalIn (plug) Return the value of a signal in the specified IN plug of the element.
mockGetClosure () Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".


Functions

activate ()
Switches the light on.
deactivate ()
Switches the light off.
isActive ()
Checks if the light is on.

Returns:

    0/1 1 if the light is on.
setRGBColor (r, g, b)
Deprecated: Set the light color in RGB.

This method is deprecated: setColor should be used instead

Parameters:

  • r 0..255 The red component, between 0 and 255.
  • g 0..255 The green component, between 0 and 255.
  • b 0..255 The blue component, between 0 and 255.

See also:

setColor (r, g, b)
Set the color of the light to RGB. Lights can use HDR color values above 1.0 to glow.

Parameters:

  • r int The red component, between 0.0 and 1.0, up to 5.0 for HDR colors.
  • g int The green component, between 0.0 and 1.0, up to 5.0 for HDR colors.
  • b int The blue component, between 0.0 and 1.0, up to 5.0 for HDR colors.
getRGBColor ()
Deprecated: Get the light color in RGB.

This method is deprecated: getColor should be used instead

Returns:

    vec3 A vec3 for the red, blue and green components of the light, with values between 0 and 255.

See also:

getColor ()
Returns the light color in RGB.

Returns:

    vec3 A vec3 for the red, blue and green components of the light, with values between 0.0 and 1.0, up to 5.0.
setBlinkingState (state)
Enables or disables the blinking state of the light.

Parameters:

  • state bool True to enable light blinking.
isBlinking ()
Checks if the light blinking is enabled.

Returns:

    0/1 1 if the light blinking is enabled.
getOnBlinkingDuration ()
Returns the light 'on' blinking duration.

Returns:

    float The duration of the 'on' blinking in seconds.
setOnBlinkingDuration (time)
Set the light 'on' blinking duration.

Parameters:

  • time float The duration of the 'on' blinking in seconds.
getOffBlinkingDuration ()
Returns the light 'off' blinking duration.

Returns:

    float The duration of the 'off' blinking in seconds.
setOffBlinkingDuration (time)
Set the light 'off' blinking duration.

Parameters:

  • time float The duration of the 'off' blinking in seconds.
getBlinkingTimeShift ()
Returns the light blinking time shift.

Returns:

    float The time shift of the blinking in seconds.
setBlinkingTimeShift (shift)
Set the light blinking time shift.

Parameters:

  • shift float The time shift of the blinking in seconds.
setSignalIn (plug, state)
Set the value of a signal in the specified IN plug of the element.

Valid plug names are:

  • "in" for the in signal (seems to have no actual effect when modified this way).

Parameters:

  • plug string A valid plug name to set.
  • state 0/1 The plug signal state
getSignalIn (plug)
Return the value of a signal in the specified IN plug of the element.

Valid plug names are:

  • "in" for the in signal.

Parameters:

  • plug string A valid plug name to query.

Returns:

    0/1 The plug signal state
mockGetClosure ()
Mock only, not in-game: Bundles the object into a closure so functions can be called with "." instead of ":".

Returns:

    table A table encompasing the api calls of object.

See also:

generated by LDoc 1.5.0 Last updated 2024-09-27 15:22:46