Docs - panes
changed panes to make it more clear why they exist
This commit is contained in:
BIN
docs/_media/pane-example-1.png
Normal file
BIN
docs/_media/pane-example-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
BIN
docs/_media/pane-example-2.png
Normal file
BIN
docs/_media/pane-example-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 717 B |
@@ -1,10 +1,10 @@
|
|||||||
With panes you are able to create background without any functionality
|
Panes are here to do some visual background modifying, without listening (by default) to any events.
|
||||||
|
|
||||||
Because panes don't have any unique functionality, there is also no method list for them.
|
Because panes don't have any unique functionality, there is also no method list for them.
|
||||||
|
|
||||||
[Object](objects/Object.md) methods also apply for panes.
|
[Object](objects/Object.md) methods also apply for panes.
|
||||||
|
|
||||||
## Example:
|
## Example
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
local mainFrame = basalt.createFrame()
|
local mainFrame = basalt.createFrame()
|
||||||
@@ -13,6 +13,29 @@ aPane:setSize(30, 10)
|
|||||||
aPane:setBackground(colors.yellow)
|
aPane:setBackground(colors.yellow)
|
||||||
aPane:show()
|
aPane:show()
|
||||||
```
|
```
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<pane width="30" height="10" bg="yellow" />
|
<pane width="30" height="10" bg="yellow" />
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Other examples
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```lua
|
||||||
|
main:addPane():setSize(15, 8):setPosition(2, 2):setBackground(colors.red)
|
||||||
|
main:addPane():setSize(15, 8):setPosition(18, 2):setBackground(colors.blue, "#")
|
||||||
|
main:addPane():setSize(15, 8):setPosition(17 * 2, 2):setBackground(colors.green, "#", colors.orange)
|
||||||
|
```
|
||||||
|
|
||||||
|
You could also create a 1-line height pane with dynamic width:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
```lua
|
||||||
|
main:addPane():setSize("parent.w - 2", 1):setPosition(2, 2):setBackground(false, "\140", colors.blue)
|
||||||
|
main:addPane():setSize("parent.w - 2", 1):setPosition(2, 4):setBackground(colors.black, "\45", colors.red)
|
||||||
|
main:addPane():setSize("parent.w - 2", 1):setPosition(2, 6):setBackground(false, "\183", colors.purple)
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also do that in y instead of x direction.
|
||||||
|
|||||||
Reference in New Issue
Block a user