From a448d87d4388853f04629e217ec9be89820e79ea Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Thu, 3 Nov 2016 23:11:57 +0100 Subject: [PATCH] Updated Layers (markdown) --- Layers.md | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/Layers.md b/Layers.md index d45f076..1f9ba61 100644 --- a/Layers.md +++ b/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 ``` \ No newline at end of file