mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 13:28:33 +00:00
Clone
10
Layers
Robert Beekman edited this page 2017-09-12 16:19:01 +02:00
Table of Contents
Once you've used the Profile variable to get a layer, you can access it's properties and functions.
In the same way a profile contains layers, a layer can also contain layers (children). These can be retrieved using the functions described below
Properties
| Name | Type | Description | Get | Set |
|---|---|---|---|---|
| Name | string | Returns or sets the name of the layer. | Yes | Yes |
| Enabled | boolean | Returns or sets whether the layer is an event or not. | Yes | Yes |
| IsEvent | boolean | Returns or sets whether the layer is an event or not. | Yes | Yes |
| Parent | layer | Returns the parent layer of the layer. | Yes | No |
| X | int | Returns or sets the X position of the layer. | Yes | Yes |
| Y | int | Returns or sets the Y position of the layer. | Yes | Yes |
| Width | int | Returns or sets the width of the layer. | Yes | Yes |
| Height | int | Returns or sets the height of the layer. | Yes | Yes |
| Contain | boolean | Returns or sets whether the layer's brush must be contained or not. | Yes | Yes |
| AnimationSpeed | double | Returns or sets the animation speed of the layer. | Yes | Yes |
| AnimationProgress | double | Returns or sets the animation progress of the layer. | Yes | Yes |
| BrushType | string | Returns brush type of the layer. | Yes | No |
| Brush | brush | Returns or sets brush of the layer. | Yes | Yes |
Example:
local layer = Profile.GetLayerByName("Test layer 1")
print(layer.Name)
Functions
GetChildren
Returns all child layers within the layer
Syntax:
table GetChildren( )
Example:
local layer = Profile.GetLayerByName("Test layer 1")
local children = layer.GetChildren()
for childKey, childValue in pairs(children) do
print(childValue.Name)
end
Result:
Test child layer 1
Test child layer 2
GetChildByName
If found, returns the first child layer with the given name.
Syntax:
layer GetChildByName(string layerName)
Example:
local layer = Profile.GetLayerByName("Test layer 1");
local child = layer.GetChildByName("Test child layer 1")
print(child.Name)
Result:
Test child layer 1