Skip to content

Commit 51f6ebe

Browse files
committed
docs updates
1 parent 4d227af commit 51f6ebe

15 files changed

Lines changed: 630 additions & 22 deletions

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@
2929
- [Button coloring](tips/buttonColoring.md)
3030
- [Designing/Animating](tips/design.md)
3131
- [Dynamic Values](tips/dynamicvalues.md)
32+
- [XML](tips/xml.md)

docs/installer.lua

Lines changed: 487 additions & 0 deletions
Large diffs are not rendered by default.

docs/objects/Animation/changeBackground.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Changes the background color while the animation is running
1414
```lua
1515
local mainFrame = basalt.createFrame()
1616
local testButton = mainFrame:addButton("buttonToAnimate")
17-
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeBackground({colors.red, colors.yellow, colors.green}, 2):play()
17+
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeTextColor(2, 0, colors.red, colors.yellow, colors.green):play()
1818
```
1919
```xml
2020
<animation object="buttonToAnimate" play="true">
@@ -25,4 +25,4 @@ local aAnimation = mainFrame:addAnimation():setObject(testButton):changeBackgrou
2525
<duration>2</duration>
2626
</background>
2727
</animation>
28-
```
28+
```

docs/objects/Animation/changeText.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Changes the text while animation is running
1414
```lua
1515
local mainFrame = basalt.createFrame()
1616
local testButton = mainFrame:addButton("buttonToAnimate")
17-
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeText({"i", "am", "groot"}, 2):play()
17+
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeText(2, 0, "i", "am", "groot"):play()
1818
```
1919
```xml
2020
<animation object="buttonToAnimate" play="true">

docs/objects/Animation/changeTextColor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Changes the text color while the animation is running
1414
```lua
1515
local mainFrame = basalt.createFrame()
1616
local testButton = mainFrame:addButton("buttonToAnimate")
17-
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeTextColor({colors.red, colors.yellow, colors.green}, 2):play()
17+
local aAnimation = mainFrame:addAnimation():setObject(testButton):changeTextColor(2, 0, colors.red, colors.yellow, colors.green):play()
1818
```
1919
```xml
2020
<animation object="buttonToAnimate" play="true">

docs/objects/Button.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ end)
2424

2525
and this would be the xml way:
2626
```lua
27-
local main = basalt.createFrame():addLayout("example.xml")
28-
2927
basalt.setVariable("buttonClick", function(self,event,button,x,y)
3028
if(event=="mouse_click")and(button==1)then
3129
basalt.debug("Left mousebutton got clicked!")
3230
end
3331
end)
32+
33+
local main = basalt.createFrame():addLayout("example.xml")
3434
```
3535
```xml
3636
<button onClick="buttonClick" text="Click" />

docs/objects/Checkbox/setSymbol.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## setSymbol
2+
Changes the checkbox symbol, default is "\42"
3+
4+
#### Parameters:
5+
1. `string` symbol
6+
7+
#### Returns:
8+
1. `object` The object in use
9+
10+
#### Usage:
11+
* Creates a new checkbox and changes the symbol to o
12+
```lua
13+
local main = basalt.createFrame()
14+
local checkbox = main:addCheckbox():setSymbol("o")
15+
```
16+
```xml
17+
<checkbox symbol="o" />
18+
```
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
## removeFocusedObject
2-
Removes the focus of the supplied object
3-
4-
#### Parameters:
5-
1. `object` The child object to remove focus from
2+
Removes the currently focused object of that frame
63

74
#### Returns:
85
1. `frame` The frame being used
96

107
#### Usage:
118
* Creates a new button then removes the focus from that button when clicking on it
129
```lua
13-
local aButton = myFrame:addButton():setFocus():onClick(function()
14-
myFrame:removeFocusedObject(aButton)
10+
local main = basalt.createFrame()
11+
local input = main:addInput():setFocus()
12+
local aButton = main:addButton():onClick(function()
13+
main:removeFocusedObject()
1514
end)
1615
```

docs/objects/Frame/removeObject.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
Removes a child object from the frame
33

44
#### Parameters:
5-
1. `string` The name of the child object
5+
1. `string|object` The name of the child object or the object itself
66

77
#### Returns:
88
1. `boolean` Whether the object with the given name was properly removed
99

1010
#### Usage:
1111
* Adds a button with the id "myFirstButton", then removes it with the aforementioned id
1212
```lua
13-
myFrame:addButton("myFirstButton")
14-
myFrame:removeObject("myFirstButton")
13+
local main = basalt.createFrame()
14+
main:addButton("myFirstButton"):setText("Close")
15+
:onClick(function(self)
16+
main:removeObject("myFirstButton") -- or main:removeObject(self)
17+
end)
1518
```

docs/objects/Image/loadImage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ loads a default .nfp file into the object.
1010
#### Usage:
1111
* Creates a default image and loads a test.nfp file
1212
```lua
13-
local mainFrame = basalt.createFrame():show()
13+
local mainFrame = basalt.createFrame()
1414
local aImage = mainFrame:addImage():loadImage("test.nfp")
1515
```
1616
```xml

0 commit comments

Comments
 (0)