From 282cd844130c1c3bef0f1e2fa90bbf9342af4b37 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sun, 24 Apr 2022 16:10:23 +0200 Subject: [PATCH] Updated Frame (markdown) --- Frame.md | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/Frame.md b/Frame.md index e37060f..8efb2ab 100644 --- a/Frame.md +++ b/Frame.md @@ -1,17 +1,19 @@ Here are all possible functions you can use with frames: +# WIP + -# NyoUI.createFrame +# basalt.createFrame this function creates a new frame ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") ```` **args:** string identifaction id. if you create 2 frames with the same id, the second one will return nil
**returns:** a new frame object
# addFrame -The same as NyoUI.createFrame, but it will have a parent frame +The same as basalt.createFrame, but it will have a parent frame ````lua frame:addFrame("myFirstFrame") ```` @@ -19,7 +21,7 @@ frame:addFrame("myFirstFrame") **returns:** a new frame object
Example: ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aFrame = mainFrame:addFrame("myFirstSubFrame") ```` # setTitle @@ -31,20 +33,20 @@ frame:setTitle("My first Frame!") **returns:** the frame object
Example: ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aFrame = MainFrame:addFrame("myFirstSubFrame") aFrame:setTitle("My first Frame!") ```` or: ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aFrame = mainFrame:addFrame("myFirstSubFrame"):setTitle("My first Frame!") ```` # setTitleAlign Sets the title alignment ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):setTitle("My first Frame!"):setTitleAlign("right") +local mainFrame = basalt.createFrame("myFirstFrame"):setTitle("My first Frame!"):setTitleAlign("right") ```` **args:** string text - possible values: "left", "center", "right"
**returns:** the frame object
@@ -54,22 +56,22 @@ local mainFrame = NyoUI.createFrame("myFirstFrame"):setTitle("My first Frame!"): # showBar shows/hides the bar on top where you will see the title if its active ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):showBar() +local mainFrame = basalt.createFrame("myFirstFrame"):showBar() ```` **args:** bool isVisible (no args = true)
**returns:** the frame object
# isModifierActive -returns true if user is currently holding a key +returns true if user is currently holding a key down ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):isModifierActive("shift") +local mainFrame = basalt.createFrame("myFirstFrame"):isModifierActive("shift") ```` **args:** int or string - int can be any os.queueEvent("key") key, or instead of int you can use the following strings: "shift", "ctrl", "alt"
**returns:** true or false if the user is holding the key down
**Example:** ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):setSize(20,8):show() +local mainFrame = basalt.createFrame("myFirstFrame"):setSize(20,8):show() local aLabel = mainFrame:addLabel("myFirstLabel"):setText("shift inactive") mainFrame:addButton("myFirstButton"):setText("Click"):onClick(function() if(mainFrame:isModifierActive("shift")then @@ -83,7 +85,7 @@ end) # remove removes the frame and its children objects completly ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):remove() +local mainFrame = basalt.createFrame("myFirstFrame"):remove() ```` **args:** -
**returns:** -
@@ -91,7 +93,7 @@ local mainFrame = NyoUI.createFrame("myFirstFrame"):remove() # getObject returns a created object (arg = id) ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") mainFrame:addButton("myFirstButton") local aButton = mainFrame:getObject("myFirstButton") ```` @@ -101,7 +103,7 @@ local aButton = mainFrame:getObject("myFirstButton") # removeObject removes the object with the id ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") mainFrame:addButton("myFirstButton") mainFrame:removeObject("myFirstButton") ```` @@ -111,7 +113,7 @@ mainFrame:removeObject("myFirstButton") # setFocusedElement changes the currently focused element ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") mainFrame:setFocusedElement(aButton) ```` @@ -120,7 +122,7 @@ mainFrame:setFocusedElement(aButton) # removeFocusedElement removes the focus of the currently focused element ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") mainFrame:removeFocusedElement(aButton) ```` @@ -130,7 +132,7 @@ mainFrame:removeFocusedElement(aButton) # getFocusedElement gets the currently focused element ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame") +local mainFrame = basalt.createFrame("myFirstFrame") local aButton = mainFrame:addButton("myFirstButton") local focusedObject = mainFrame:getFocusedElement() ```` @@ -141,7 +143,7 @@ local focusedObject = mainFrame:getFocusedElement() sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar) ````lua -local mainFrame = NyoUI.createFrame("myFirstFrame"):setMoveable(true) +local mainFrame = basalt.createFrame("myFirstFrame"):setMoveable(true) ```` **args:** bool
**returns:** object