mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Updated Layers (markdown)
parent
742e075f1c
commit
a448d87d43
52
Layers.md
52
Layers.md
@ -1,4 +1,5 @@
|
|||||||
Once you've used the Profile variable to get a layer, you can access it's properties and functions.
|
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
|
## Properties
|
||||||
| Name | Type | Description | Get | Set |
|
| Name | Type | Description | Get | Set |
|
||||||
@ -25,38 +26,39 @@ print(layer.Name)
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
### GetLayers
|
### GetChildren
|
||||||
Returns all layers within the profile
|
Returns all child layers within the layer
|
||||||
#### Syntax:
|
#### Syntax:
|
||||||
```lua
|
```lua
|
||||||
table GetLayers( );
|
table GetChildren( );
|
||||||
```
|
|
||||||
#### Example:
|
|
||||||
```lua
|
|
||||||
local layers = Profile.GetLayers();
|
|
||||||
for layerKey, layerValue in pairs(layers) do
|
|
||||||
print(layerValue.Name)
|
|
||||||
end
|
|
||||||
```
|
|
||||||
#### Result:
|
|
||||||
```
|
|
||||||
Test layer 1
|
|
||||||
Test layer 2
|
|
||||||
```
|
|
||||||
|
|
||||||
### GetLayerByName
|
|
||||||
If found, returns the first layer with the given name
|
|
||||||
#### Syntax:
|
|
||||||
```lua
|
|
||||||
layer GetLayerByName(string layerName);
|
|
||||||
```
|
```
|
||||||
#### Example:
|
#### Example:
|
||||||
```lua
|
```lua
|
||||||
local layer = Profile.GetLayerByName("Test layer 1");
|
local layer = Profile.GetLayerByName("Test layer 1");
|
||||||
print(layer.Name)
|
local children = layer.GetChildren();
|
||||||
|
for childKey, childValue in pairs(children) do
|
||||||
|
print(childValue.Name)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
#### Result:
|
#### Result:
|
||||||
```
|
```
|
||||||
Test layer 1
|
Test child layer 1
|
||||||
|
Test child layer 2
|
||||||
|
```
|
||||||
|
|
||||||
|
### GetLayerByName
|
||||||
|
If found, returns the first child layer with the given name.
|
||||||
|
#### Syntax:
|
||||||
|
```lua
|
||||||
|
layer GetChildByName(string layerName);
|
||||||
|
```
|
||||||
|
#### Example:
|
||||||
|
```lua
|
||||||
|
local layer = Profile.GetLayerByName("Test layer 1");
|
||||||
|
local child = layer.GetChildByName("Test child layer 1");
|
||||||
|
print(child.Name)
|
||||||
|
```
|
||||||
|
#### Result:
|
||||||
|
```
|
||||||
|
Test child layer 1
|
||||||
```
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user