Class: Layers

Layers(oRadialMenu)

new Layers(oRadialMenu)

Creates a collection of layers for the radial-menu control.
Parameters:
Name Type Description
oRadialMenu RadialMenu Specifies an object of RadialMenu type

Methods

Add(key) → {Layer}

The Add() method creates and adds/gets a Layer object to the collection and returns a reference to the newly created object.
Parameters:
Name Type Description
key any Specifies the layer's key (ignored if missing)
Returns:
Returns an object of Layer type
Type
Layer

bU()

The bU() method locks invalidating the control until the eU() method is called

Clear()

The Clear() method removes all layers within the collection

eU(bRL)

The eU() method validates the control when the lI counter is zero, else keeps lock invalidating the control.
Parameters:
Name Type Description
bRL boolean Indicates whether the control requires a new layout (by default, true if missing)

forEach(mask)

The forEach() method enumerates the layers that matches the mask (visible/selectable)
Parameters:
Name Type Description
mask number Specifies the type or order of the layers to get enumerated as follows (RadialMenu.ViewableLObjEnum type):
  • 0/null/undefined/missing, enumerates all layers by position
  • -1, enumerates all layers by index
  • 1 (RadialMenu.ViewableLObjEnum.exVisible), enumerates visible-layers only, by position
  • 2 (RadialMenu.ViewableLObjEnum.exSelectable), enumerates selectable-layers only, by position
The mask can combine the value of 1 and 2 as (1 + 2 = 3) to enumerate all visible and selectable layers.

GetCount() → {number}

The GetCount() method specifies the number of layers.
Returns:
Indicates the number of layers
Type
number

GetValue() → {number}

The GetValue() method specifies the control's value. Generally, the control's value gets the value (offset or its rotation angle) of the layer based on the OnDrag property.
Returns:
Returns the control's value.
Type
number

Item(key) → {Layer}

The Item() method returns a specific Layer of the Layers collection
Parameters:
Name Type Description
key any Specifies an integer expression that indicates the index of the layer to be requested, or any other value that indicates the key of the layer (layer's key or back).
Returns:
Returns an object of Layer type associated with the giving index/key
Type
Layer

Load(value)

The Load() method loads the layers from a string-representation
Parameters:
Name Type Description
value string Specifies the string-representation to get the control's layers from

Remove(key)

The Remove() method removes a specific member from the Layers collection.
Parameters:
Name Type Description
key any Specifies an integer expression that specifies the index of the layer to be removed, or any other value to specify the key of the layer to be removed.

Save() → {string}

The Save() method saves the layers into a string-representation
Returns:
Returns the string-representation of the control's layers
Type
string

SetCount(value)

The GetCount() method specifies the number of layers.
Parameters:
Name Type Description
value number Specifies the number of layers

SetValue(value)

The SetValue() method changes the control's value.
Parameters:
Name Type Description
value number Specifies the index or the key of the layer whose value determines the control's Value property.