diff --git a/Object.md b/Object.md index fea81ec..cf27f4d 100644 --- a/Object.md +++ b/Object.md @@ -4,7 +4,7 @@ Here is a list of possible functions: ## show shows the object (only if the parent frame is already visible) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local button = mainFrame:addButton("myFirstButton") button:show() ```` @@ -14,7 +14,7 @@ button:show() ## hide hides the object ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local button = mainFrame:addButton("myFirstButton"):setText("Close"):onClick(function() mainFrame:hide() end) button:show() ````s @@ -24,7 +24,7 @@ button:show() # setPosition Changes the position relative to its parent frame ````lua -local mainFrame = CreateFrame("myFirstFrame"):setPosition(2,3) +local mainFrame = NyoUI.createFrame("myFirstFrame"):setPosition(2,3) ```` **args:** int x, int y
**returns:** the frame object
@@ -34,7 +34,7 @@ local mainFrame = CreateFrame("myFirstFrame"):setPosition(2,3) ## setBackground Changes the object background color ````lua -local mainFrame = CreateFrame("myFirstFrame"):setBackground(colors.lightGray) +local mainFrame = NyoUI.createFrame("myFirstFrame"):setBackground(colors.lightGray) ```` **args:** int color
**returns:** the object
@@ -42,7 +42,7 @@ local mainFrame = CreateFrame("myFirstFrame"):setBackground(colors.lightGray) ## setForeground Changes the object text color ````lua -local mainFrame = CreateFrame("myFirstFrame"):setForeground(colors.black) +local mainFrame = NyoUI.createFrame("myFirstFrame"):setForeground(colors.black) ```` **args:** int color
**returns:** the object
@@ -50,7 +50,7 @@ local mainFrame = CreateFrame("myFirstFrame"):setForeground(colors.black) ## setSize Changes the object size ````lua -local mainFrame = CreateFrame("myFirstFrame"):setSize(15,5) +local mainFrame = NyoUI.createFrame("myFirstFrame"):setSize(15,5) ```` **args:** width, length
**returns:** the object
@@ -58,7 +58,7 @@ local mainFrame = CreateFrame("myFirstFrame"):setSize(15,5) ## setFocus sets the object to be the focused object ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setFocus():show() ```` **args:** -
@@ -67,7 +67,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setFocus():show() ## setZIndex changes the z index (lower z index do have higher draw priority) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setZIndex(1):show() ```` **args:** index
@@ -76,8 +76,8 @@ local aButton = mainFrame:addButton("myFirstButton"):setZIndex(1):show() ## setParent changes the frame parent of that object ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() -local aRandomFrame = CreateFrame("aRandomFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() +local aRandomFrame = NyoUI.createFrame("aRandomFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):onClick(function() aRandomFrame:setParent(mainFrame) end):show() ```` **args:** frame object
@@ -87,7 +87,7 @@ local aButton = mainFrame:addButton("myFirstButton"):onClick(function() aRandomF returns if the object is currently the focused object of the parent frame ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):show() NyoUI.debug(aButton:isFocusedObject()) -- shows true or false as a debug message ```` @@ -98,7 +98,7 @@ NyoUI.debug(aButton:isFocusedObject()) -- shows true or false as a debug message converts the x,y coordinates into the anchor coordinates of that object ````lua -local mainFrame = CreateFrame("myFirstFrame"):setSize(15,15):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):setSize(15,15):show() local aButton = mainFrame:addButton("myFirstButton"):setAnchor("right","bottom"):setSize(8,1):setPosition(1,1):show() NyoUI.debug(aButton:getAnchorPosition()) -- returns 7,14 (framesize - own size) instead of 1,1 ```` @@ -109,7 +109,7 @@ NyoUI.debug(aButton:getAnchorPosition()) -- returns 7,14 (framesize - own size) sets the anchor of that object ````lua -local mainFrame = CreateFrame("myFirstFrame"):setAnchor("right"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):setAnchor("right"):show() local aButton = mainFrame:addButton("myFirstButton"):setAnchor("bottom","right"):setSize(8,1):setPosition(1,1):show() ```` **args:** "left", "right", "top", "bottom" - doesn't matter which order
@@ -118,7 +118,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setAnchor("bottom","right") ## relativeToAbsolutePosition converts the relative coordinates into absolute coordinates ````lua -local mainFrame = CreateFrame("myFirstFrame"):setPosition(3,3):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):setPosition(3,3):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(8,1):setPosition(4,2):show() NyoUI.debug(aButton:relativeToAbsolutePosition()) -- returns 7,5 (frame coords + own coords) instead of 4,2 ```` @@ -128,7 +128,7 @@ NyoUI.debug(aButton:relativeToAbsolutePosition()) -- returns 7,5 (frame coords + ## setTextAlign sets the align of the object (as example buttons) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(12,3):setTextAlign("right", "center"):setText("Dont't..."):show() ```` **args:** horizontal,vertical you can use "left", "center", "right"
@@ -140,7 +140,7 @@ WIP ## setValue sets the value of that object (input, label, checkbox, textfield, scrollbar,...) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):setValue(true):show() ```` **args:** value (text,checked,number,...)
@@ -149,7 +149,7 @@ local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):setValue(true):show() ## getValue returns the currently saved value ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):setValue(true):show() NyoUI.debug(aCheckbox:getValue()) -- returns true ```` @@ -165,7 +165,7 @@ WIP done but buggy have to look ## getHeight/getWidth returns the height or width of that object ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(5,8):show() NyoUI.debug(aButton:getHeight()) -- returns 8 ```` @@ -175,7 +175,7 @@ NyoUI.debug(aButton:getHeight()) -- returns 8 ## isVisible returns if the object is currently visible ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(5,8):show() NyoUI.debug(aButton:isVisible()) -- returns true ```` @@ -185,7 +185,7 @@ NyoUI.debug(aButton:isVisible()) -- returns true ## getName returns the given name of that object ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() NyoUI.debug(mainFrame:getName()) -- returns myFirstFrame ```` **args:**-
@@ -197,7 +197,7 @@ These object events are available for all objects, if a object got some unique e ## onClick creates a mouse_click event ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClick(function(self,event,button,x,y) NyoUI.debug("Hellooww UwU") end):show() ```` **args:** function
@@ -206,7 +206,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClick(funct ## onClickUp creates a click_up event ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClickUp(function(self,event,button,x,y) NyoUI.debug("Byeeeee UwU") end):show() ```` **args:** function
@@ -215,7 +215,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClickUp(fun ## onMouseDrag creates a mouse_drag event ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClickUp(function(self,event,button,x,y) NyoUI.debug("Byeeeee UwU") end):show() ```` **args:** function
@@ -224,7 +224,7 @@ local aButton = mainFrame:addButton("myFirstButton"):setSize(10,3):onClickUp(fun ## onChange creates a change event (fires as soon as the value gets changed) ````lua -local mainFrame = CreateFrame("myFirstFrame"):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):show() local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):onChange(function(self) NyoUI.debug("i got changed into "..self:getValue()) end):show() ```` **args:** function
@@ -233,7 +233,7 @@ local aCheckbox = mainFrame:addCheckbox("myFirstCheckbox"):onChange(function(sel ## onKey creates a key(board) - event can be key or char ````lua -local mainFrame = CreateFrame("myFirstFrame"):onKey(function(self,event,key) NyoUI.debug("you clicked "..key) end):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):onKey(function(self,event,key) NyoUI.debug("you clicked "..key) end):show() ```` **args:** function
**returns:** the object
@@ -241,7 +241,7 @@ local mainFrame = CreateFrame("myFirstFrame"):onKey(function(self,event,key) Nyo ## onLoseFocus creates a lose focus event ````lua -local mainFrame = CreateFrame("myFirstFrame"):onLoseFocus(function(self) NyoUI.debug("please come back..") end):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):onLoseFocus(function(self) NyoUI.debug("please come back..") end):show() ```` **args:** function
**returns:** the object
@@ -249,7 +249,7 @@ local mainFrame = CreateFrame("myFirstFrame"):onLoseFocus(function(self) NyoUI.d ## onGetFocus creates a get focus event ````lua -local mainFrame = CreateFrame("myFirstFrame"):onGetFocus(function(self) NyoUI.debug("thanks!") end):show() +local mainFrame = NyoUI.createFrame("myFirstFrame"):onGetFocus(function(self) NyoUI.debug("thanks!") end):show() ```` **args:** function
**returns:** the object
\ No newline at end of file