-
Notifications
You must be signed in to change notification settings - Fork 42
Frame
Here are all possible functions you can use with frames:
this function creates a new frame
local mainFrame = 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
The same as CreateFrame, but it will have a parent frame
frame:addFrame("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
Example:
local mainFrame = CreateFrame("myFirstFrame")
local aFrame = mainFrame:addFrame("myFirstSubFrame")Changes the title from a frame
frame:setTitle("My first Frame!")args: string text
returns: the frame object
Example:
local mainFrame = CreateFrame("myFirstFrame")
local aFrame = MainFrame:addFrame("myFirstSubFrame")
aFrame:setTitle("My first Frame!")or:
local mainFrame = CreateFrame("myFirstFrame")
local aFrame = mainFrame:addFrame("myFirstSubFrame"):setTitle("My first Frame!")Sets the title alignment
local mainFrame = CreateFrame("myFirstFrame"):setTitle("My first Frame!"):setTitleAlign("right")args: string text - possible values: "left", "center", "right"
returns: the frame object
shows/hides the bar on top where you will see the title if its active
local mainFrame = CreateFrame("myFirstFrame"):showBar()args: bool isVisible (no args = true)
returns: the frame object
returns true if user is currently holding a key
local mainFrame = 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:
local mainFrame = 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
aLabel:setText("shift is active yay")
else
aLabel:setText("shift is not active ohno")
end)removes the frame and its children objects completly
local mainFrame = CreateFrame("myFirstFrame"):remove()args: -
returns: -
returns a created object (arg = id)
local mainFrame = CreateFrame("myFirstFrame")
mainFrame:addButton("myFirstButton")
local aButton = mainFrame:getObject("myFirstButton")args: the id of the created object (has to be a child from the frame
returns: object or nil
removes the object with the id
local mainFrame = CreateFrame("myFirstFrame")
mainFrame:addButton("myFirstButton")
mainFrame:removeObject("myFirstButton")args: the id of the created object (has to be a child from the frame
returns: object or nil
changes the currently focused element
local mainFrame = CreateFrame("myFirstFrame")
local aButton = mainFrame:addButton("myFirstButton")
mainFrame:setFocusedElement(aButton)args: the object you want to set as focus, has to be a children
returns: the frame object
removes the focus of the currently focused element
local mainFrame = CreateFrame("myFirstFrame")
local aButton = mainFrame:addButton("myFirstButton")
mainFrame:removeFocusedElement(aButton)args: the object you want to set as focus, has to be a children
returns: the frame object
gets the currently focused element
local mainFrame = CreateFrame("myFirstFrame")
local aButton = mainFrame:addButton("myFirstButton")
local focusedObject = mainFrame:getFocusedElement()args: -
returns: object
sets if the frame should be moveable or not (to move the frame you need to drag it on the top bar)
local mainFrame = CreateFrame("myFirstFrame"):setMoveable(true)args: bool
returns: object
Thanks for checking out our wiki, join our discord for more help: discord.gg/yM7kndJdJJ
