Skip to content

Commit 1198a5b

Browse files
authored
Update Object.md
1 parent c280f8b commit 1198a5b

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

docs/objects/Object.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Changes the position relative to its parent frame
3838
1. `object` The object in use
3939

4040
#### Usage:
41-
* Sets the frame's position to an x coordinate of 2 with a y coordinate of 3
41+
* Sets the Buttons position to an x coordinate of 2 with a y coordinate of 3
4242
```lua
43-
local mainFrame = basalt.createFrame("myFirstFrame"):setPosition(2,3)
43+
local mainFrame = basalt.createFrame("myFirstFrame"):show()
44+
mainFrame:addButton("myFirstButton"):setPosition(2,3)
4445
```
4546

4647
## setBackground
@@ -52,9 +53,9 @@ Changes the object background color, if you set the value to false the backgroun
5253
1. `object` The object in use
5354

5455
#### Usage:
55-
* Creates a frame, and sets its background color to `colors.lightGray`
56+
* Creates a frame, and sets its background color to `colors.gray`
5657
```lua
57-
local mainFrame = basalt.createFrame("myFirstFrame"):setBackground(colors.lightGray)
58+
local mainFrame = basalt.createFrame("myFirstFrame"):setBackground(colors.gray)
5859
```
5960

6061
## setForeground
@@ -66,9 +67,9 @@ Changes the object text color
6667
1. `object` The object in use
6768

6869
#### Usage:
69-
* Creates a frame, and sets its foreground color to `colors.black`
70+
* Creates a frame, and sets its foreground color to `colors.green`
7071
```lua
71-
local mainFrame = basalt.createFrame("myFirstFrame"):setForeground(colors.black)
72+
local mainFrame = basalt.createFrame("myFirstFrame"):setForeground(colors.green)
7273
```
7374

7475
## setSize
@@ -81,15 +82,16 @@ Changes the object size
8182
1. `object` The object in use
8283

8384
#### Usage:
84-
* Sets the frame to have a width of 15 and a height of 5
85+
* Sets the frame to have a width of 15 and a height of 12
8586
```lua
86-
local mainFrame = basalt.createFrame("myFirstFrame"):setSize(15,5)
87+
local mainFrame = basalt.createFrame("myFirstFrame"):show()
88+
local subFrame = mainFrame:addFrame("myFirstSubFrame"):setSize(15,12):show()
8789
```
8890

8991
## setFocus
9092
Sets the object to be the focused object.
9193
If you click on an object, it's normally automatically the focused object. For example, if you call :show() on a frame, and you want this particular frame to be in
92-
the foreground, you should use :setFocus()
94+
the foreground, you should also use :setFocus()
9395
#### Returns:
9496
1. `object` The object in use
9597

@@ -101,18 +103,19 @@ local aButton = mainFrame:addButton("myFirstButton"):setFocus():show()
101103
```
102104

103105
## setZIndex
104-
Sets the z index where a higher z index has higher draw/event priority, with higher values higher priority. You are also able to add multiple objects to the same z index. On the same z index: the last created object has the highest priority.
106+
Sets the z-index. Higher value means higher draw/event priority. You can also add multiple objects to the same z-index, if so the last added object will have the highest priority.
105107
#### Parameters:
106108
1. `number` z-index
107109

108110
#### Returns:
109111
1. `object` The object in use
110112

111113
#### Usage:
112-
* Sets the z-index of "myFirstButton" to `1`
114+
* Sets the z-index of "myFirstButton" to `1` and the z-index of "myFirstLabel" to `1`
113115
```lua
114116
local mainFrame = basalt.createFrame("myFirstFrame"):show()
115-
local aButton = mainFrame:addButton("myFirstButton"):setZIndex(1):show()
117+
local aButton = mainFrame:addButton("myFirstButton"):setZIndex(1):setPosition(2,2):show()
118+
local aLabel = mainFrame:addButton("myFirstLabel"):setZIndex(2):setPosition(2,2):setText("I am a label!"):show()
116119
```
117120

118121
## setParent
@@ -165,7 +168,7 @@ Converts the x and y coordinates into the anchor coordinates of the object
165168
```lua
166169
local mainFrame = basalt.createFrame("myFirstFrame"):setSize(15,15):show()
167170
local aButton = mainFrame:addButton("myFirstButton")
168-
:setAnchor("right","bottom")
171+
:setAnchor("bottomRight")
169172
:setSize(8,1)
170173
:setPosition(1,1)
171174
:show()
@@ -182,7 +185,7 @@ Sets the anchor of the object
182185
1. `object` The object in use
183186

184187
#### Usage:
185-
* Sets the mainFrame to have an anchor of `right` and aButton to have an anchor of `bottom, right`
188+
* Sets the button to have an anchor of `bottomRight`
186189
```lua
187190
local mainFrame = basalt.createFrame("myFirstFrame"):show()
188191
local aButton = mainFrame:addButton("myFirstButton")

0 commit comments

Comments
 (0)