From 038a5f091105e03c44b978cfd3e5d1e0b8a4be39 Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Thu, 3 Nov 2016 22:13:23 +0100 Subject: [PATCH] Created Layers (markdown) --- Layers.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Layers.md diff --git a/Layers.md b/Layers.md new file mode 100644 index 0000000..2dd884e --- /dev/null +++ b/Layers.md @@ -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 +``` \ No newline at end of file