From 4f1baee7718a1c341d71bc4c58b6358d0209ba2d Mon Sep 17 00:00:00 2001 From: Erb3 <49862976+Erb3@users.noreply.github.com> Date: Thu, 15 Sep 2022 15:34:59 +0200 Subject: [PATCH] Docs: Update basalt.removeFrame.md --- docs/objects/Basalt/removeFrame.md | 35 +++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/docs/objects/Basalt/removeFrame.md b/docs/objects/Basalt/removeFrame.md index 999fca6..ff2d5f9 100644 --- a/docs/objects/Basalt/removeFrame.md +++ b/docs/objects/Basalt/removeFrame.md @@ -1,17 +1,36 @@ -## basalt.removeFrame -Removes the base frame by it's id. This only works for base-frames. -#### Parameters: -1. `string` id +# basalt.removeFrame + +Removes the base frame by it's id. **This only works for base-frames.** + +## Parameters + +1. `string` id - ID of the base-frame. + +## Usage + +* Removes the previously created frame with id "secondBaseFrame" +The frame id is gotten from a frame variable's `:getName()` -#### Usage: -* Removes the previously created frame with id "myFirstFrame" ```lua local main = basalt.createFrame("firstBaseFrame") local main2 = basalt.createFrame("secondBaseFrame") main:addButton() :setText("Remove") :onClick(function() - basalt.removeFrame(main2:getName()) -- you can use main2:getName() to find out the id or just use "secondBaseFrame" + basalt.removeFrame(main2:getName()) end) -``` \ No newline at end of file +``` + +* Removes the previously created frame with id "secondBaseFrame", without frame stored in variable +The frame id is the frame's name + +```lua +local main = basalt.createFrame("firstBaseFrame") +local main2 = basalt.createFrame("secondBaseFrame") +main:addButton() + :setText("Remove") + :onClick(function() + basalt.removeFrame("secondBaseFrame") + end) +```