mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Created Layers (markdown)
parent
6d20f7dbde
commit
038a5f0911
65
Layers.md
Normal file
65
Layers.md
Normal file
@ -0,0 +1,65 @@
|
||||
Once you've used the Profile variable to get a layer, you can access it's properties and functions.
|
||||
|
||||
## Properties
|
||||
- **Name:** Returns or sets the name of the layer.
|
||||
- **Enabled:** Returns or sets whether the layer is enabled or not.
|
||||
- **IsEvent:** Returns or sets whether the layer is an event or not.
|
||||
- **Parent (read only):** Returns the parent layer of the layer.
|
||||
- **X:** Returns or sets the X position of the layer.
|
||||
- **Y:** Returns or sets the Y position of the layer.
|
||||
- **Width:** Returns or sets the width of the layer.
|
||||
- **Height:** Returns or sets the height of the layer.
|
||||
- **Contain:** Returns or sets whether the layer's brush must be contained or not.
|
||||
- **Opacity:** Returns or sets the opacity of the layer (0.0 to 1.0).
|
||||
- **AnimationSpeed:** Returns or sets the animation speed of the layer.
|
||||
- **AnimationProgress:** Returns or sets the animation progress of the layer.
|
||||
- **BrushType (read only):** Returns brush type of the layer.
|
||||
- **Brush:** Returns or sets brush of the layer.
|
||||
### Name
|
||||
Returns the name of the current profile.
|
||||
### Enabled
|
||||
Returns the name of the current profile.
|
||||
### IsEvent
|
||||
Returns the name of the current profile.
|
||||
### Parent
|
||||
Returns the name of the current profile.
|
||||
### X
|
||||
Returns the name of the current profile.
|
||||
### Y
|
||||
Returns the name of the current profile.
|
||||
## Functions
|
||||
### GetLayers
|
||||
Returns all layers within the profile
|
||||
#### 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);
|
||||
```
|
||||
#### Example:
|
||||
```lua
|
||||
local layer = Profile.GetLayerByName("Test layer 1");
|
||||
print(layer.Name)
|
||||
end
|
||||
```
|
||||
#### Result:
|
||||
```
|
||||
Test layer 1
|
||||
```
|
||||
Loading…
x
Reference in New Issue
Block a user