This commit is contained in:
Sabine Lim
2023-05-08 18:56:12 +10:00
parent 3de3fbecb3
commit 166a234bd2
2 changed files with 26 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ In addition to the methods inherited from Frame, Container, VisualObject and Obj
|[getSpacing](objects/Flexbox/getSpacing.md)|Returns the space between objects
|[setFlexDirection](objects/Flexbox/setFlexDirection.md)|Sets the direction in which the children will be placed
|[setJustifyContent](objects/Flexbox/setJustifyContent.md)|Determines how the children are aligned along the main axis
|[setAlignItems](objects/Flexbox/setAlignItems.md)|Determines how the children are aligned along the off axis
### Example
@@ -18,11 +19,12 @@ local main = basalt.createFrame()
local flexbox = main:addFlexbox()
:setFlexDirection("column")
:setJustifyContent("space-between")
:setAlignItems("center")
:setSpacing(5)
```
Alternatively, you can create a flexbox using an XML layout:
```xml
<flexbox flexDirection="column" justifyContent="space-between" spacing="5">
<flexbox flexDirection="column" justifyContent="space-between" alignItems="center" spacing="5">
```

View File

@@ -0,0 +1,23 @@
## setJustifyContent
### Description
Determines how the children are aligned along the off axis
### Parameters
1. `string` One of ("flex-start", "flex-end", "center", "space-between", "space-around") - default is flex-start. Works the same as the property of the same name in [CSS flexboxes](https://css-tricks.com/snippets/css/a-guide-to-flexbox/#aa-flexbox-properties)
### Returns
1. `object` The object in use
### Usage
* Creates a default flexbox and sets the align items to space-between.
```lua
local main = basalt.createFrame()
local flexbox = mainFrame:addFlexbox()
:setAlignItems("space-between")
```