Sinespace Client  2023.2.17543
Client-side scripting for Sinespace
SineSpace.Scripting.Types.SLayerMask Class Reference

Public Member Functions

void SetLayers (params string[] layerNames)
 
void SetLayers (Table layerNames)
 Set layers with a lua table More...
 
 SLayerMask (params string[] layerNames)
 
void AddLayer (string layerName)
 Add a new layer in LayerMask. More...
 
void RemoveLayer (string layerName)
 Remove a layer in LayerMask. More...
 

Static Public Member Functions

static SLayerMask New (Table layerNames)
 Returns a new LayerMask with a lua table. More...
 
static SLayerMask New (params string[] layerNames)
 

Properties

bool Inverted [get, set]
 If Inverted is true, the layer mask will act as an exclusionary mask instead of an inclusionary mask. Example: If you have a mask set to "Avatars", inverted == false means you get a mask of ONLY Avatars. If you have a mask set to "Avatars", inverted == true means you get a mask of everything EXCEPT Avatars. More...
 
string[] Layers [get, set]
 All layers in LayerMask. More...
 

Constructor & Destructor Documentation

◆ SLayerMask()

SineSpace.Scripting.Types.SLayerMask.SLayerMask ( params string[]  layerNames)

Member Function Documentation

◆ AddLayer()

void SineSpace.Scripting.Types.SLayerMask.AddLayer ( string  layerName)

Add a new layer in LayerMask.

Parameters
layerNameThe name of layer
local newLayer={"Default","Water","UI","Player"}
–The layers must already exist in game.
LayerMask.SetLayers(newLayer)
LayerMask.AddLayer("Avatars")
for key, value in pairs(LayerMask.Layers) do
Space.Log(key.." "..value)
end

◆ New() [1/2]

static SLayerMask SineSpace.Scripting.Types.SLayerMask.New ( params string[]  layerNames)
static

◆ New() [2/2]

static SLayerMask SineSpace.Scripting.Types.SLayerMask.New ( Table  layerNames)
static

Returns a new LayerMask with a lua table.

Parameters
layerNamesThe table of layerNames
local newLayer={"Default","Water","UI","Player"}
–The layers must already exist in game.
local layers=LayerMask.New(newLayer)
for key, value in pairs(layers.Layers) do
Space.Log(key.." "..value)
end

◆ RemoveLayer()

void SineSpace.Scripting.Types.SLayerMask.RemoveLayer ( string  layerName)

Remove a layer in LayerMask.

Parameters
layerNameThe name of layer
local newLayer={"Default","Water","UI","Player"}
–The layers must already exist in game.
LayerMask.SetLayers(newLayer)
LayerMask.RemoveLayer("Water")
for key, value in pairs(LayerMask.Layers) do
Space.Log(key.." "..value)
end

◆ SetLayers() [1/2]

void SineSpace.Scripting.Types.SLayerMask.SetLayers ( params string[]  layerNames)

◆ SetLayers() [2/2]

void SineSpace.Scripting.Types.SLayerMask.SetLayers ( Table  layerNames)

Set layers with a lua table

Parameters
layerNamesThe table of layerNames
local newLayer={"Default","Water","UI","Player"}
–The layers must already exist in game.
LayerMask.SetLayers(newLayer)
for key, value in pairs(LayerMask.Layers) do
Space.Log(key.." "..value)
end

Property Documentation

◆ Inverted

bool SineSpace.Scripting.Types.SLayerMask.Inverted
getset

If Inverted is true, the layer mask will act as an exclusionary mask instead of an inclusionary mask. Example: If you have a mask set to "Avatars", inverted == false means you get a mask of ONLY Avatars. If you have a mask set to "Avatars", inverted == true means you get a mask of everything EXCEPT Avatars.

–set value
LayerMask.Inverted= true
–get value
Space.Log(LayerMask.Inverted)

◆ Layers

string [] SineSpace.Scripting.Types.SLayerMask.Layers
getset

All layers in LayerMask.

Parameters
layerNameThe name of layer
local newLayer={"Default","Water","UI","Player"}
–The layers must already exist in game.
LayerMask.SetLayers(newLayer)
for key, value in pairs(LayerMask.Layers) do
Space.Log(key.." "..value)
end