Updated Object (markdown)
17
Object.md
17
Object.md
@@ -83,13 +83,13 @@ local aButton = mainFrame:addButton("myFirstButton"):onClick(function() aRandomF
|
|||||||
**args:** frame object<br>
|
**args:** frame object<br>
|
||||||
**returns:** the object<br>
|
**returns:** the object<br>
|
||||||
|
|
||||||
## isFocusedObject
|
## isFocused
|
||||||
returns if the object is currently the focused object of the parent frame
|
returns if the object is currently the focused object of the parent frame
|
||||||
|
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):show()
|
||||||
local aButton = mainFrame:addButton("myFirstButton"):show()
|
local aButton = mainFrame:addButton("myFirstButton"):show()
|
||||||
basalt.debug(aButton:isFocusedObject()) -- shows true or false as a debug message
|
basalt.debug(aButton:isFocused()) -- shows true or false as a debug message
|
||||||
````
|
````
|
||||||
**args:** -<br>
|
**args:** -<br>
|
||||||
**returns:** true or false<br>
|
**returns:** true or false<br>
|
||||||
@@ -115,12 +115,12 @@ local aButton = mainFrame:addButton("myFirstButton"):setAnchor("bottom","right")
|
|||||||
**args:** "left", "right", "top", "bottom" - doesn't matter which order<br>
|
**args:** "left", "right", "top", "bottom" - doesn't matter which order<br>
|
||||||
**returns:** the object<br>
|
**returns:** the object<br>
|
||||||
|
|
||||||
## relativeToAbsolutePosition
|
## getAbsolutePosition
|
||||||
converts the relative coordinates into absolute coordinates
|
converts the relative coordinates into absolute coordinates
|
||||||
````lua
|
````lua
|
||||||
local mainFrame = basalt.createFrame("myFirstFrame"):setPosition(3,3):show()
|
local mainFrame = basalt.createFrame("myFirstFrame"):setPosition(3,3):show()
|
||||||
local aButton = mainFrame:addButton("myFirstButton"):setSize(8,1):setPosition(4,2):show()
|
local aButton = mainFrame:addButton("myFirstButton"):setSize(8,1):setPosition(4,2):show()
|
||||||
basalt.debug(aButton:relativeToAbsolutePosition()) -- returns 7,5 (frame coords + own coords) instead of 4,2
|
basalt.debug(aButton:getAbsolutePosition()) -- returns 7,5 (frame coords + own coords) instead of 4,2
|
||||||
````
|
````
|
||||||
**args:** x,y or nothing - if nothing it uses the object x,y<br>
|
**args:** x,y or nothing - if nothing it uses the object x,y<br>
|
||||||
**returns:** the object<br>
|
**returns:** the object<br>
|
||||||
@@ -134,9 +134,6 @@ local aButton = mainFrame:addButton("myFirstButton"):setSize(12,3):setTextAlign(
|
|||||||
**args:** horizontal,vertical you can use "left", "center", "right"<br>
|
**args:** horizontal,vertical you can use "left", "center", "right"<br>
|
||||||
**returns:** the object<br>
|
**returns:** the object<br>
|
||||||
|
|
||||||
## setCustomArgs
|
|
||||||
WIP
|
|
||||||
|
|
||||||
## setValue
|
## setValue
|
||||||
sets the value of that object (input, label, checkbox, textfield, scrollbar,...)
|
sets the value of that object (input, label, checkbox, textfield, scrollbar,...)
|
||||||
````lua
|
````lua
|
||||||
@@ -156,12 +153,6 @@ basalt.debug(aCheckbox:getValue()) -- returns true
|
|||||||
**args:**-<br>
|
**args:**-<br>
|
||||||
**returns:** the value<br>
|
**returns:** the value<br>
|
||||||
|
|
||||||
## isLinked
|
|
||||||
WIP done but buggy have to look
|
|
||||||
|
|
||||||
## linkTo
|
|
||||||
WIP done but buggy have to look
|
|
||||||
|
|
||||||
## getHeight/getWidth
|
## getHeight/getWidth
|
||||||
returns the height or width of that object
|
returns the height or width of that object
|
||||||
````lua
|
````lua
|
||||||
|
|||||||
Reference in New Issue
Block a user