From e862511cea2512148533213c5898b268b07664cd Mon Sep 17 00:00:00 2001 From: Robert Beekman Date: Tue, 1 Nov 2016 17:42:18 +0100 Subject: [PATCH] Created [LUA] Profile (markdown) --- [LUA]-Profile.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 [LUA]-Profile.md diff --git a/[LUA]-Profile.md b/[LUA]-Profile.md new file mode 100644 index 0000000..af96f3a --- /dev/null +++ b/[LUA]-Profile.md @@ -0,0 +1,52 @@ +The Profile variable lets you interact with the profile the LUA script resides in. + +## Properties +### Name +Returns the name of the current profile. + +#### Example: +```lua +print("Current profile: ".. Profile.Name); +``` + +#### Result: +``` +Current profile: Test +``` + +## 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