mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +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
|
||||
| Name | Type | Description | Get | Set |
|
||||
@ -25,38 +26,39 @@ print(layer.Name)
|
||||
```
|
||||
|
||||
## Functions
|
||||
### GetLayers
|
||||
Returns all layers within the profile
|
||||
### GetChildren
|
||||
Returns all child layers within the layer
|
||||
#### Syntax:
|
||||
```lua
|
||||
table GetLayers( );
|
||||
```
|
||||
#### 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);
|
||||
table GetChildren( );
|
||||
```
|
||||
#### Example:
|
||||
```lua
|
||||
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
|
||||
```
|
||||
#### 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