diff --git a/docs/objects/Flexbox.md b/docs/objects/Flexbox.md index 98e02c3..ca9770d 100644 --- a/docs/objects/Flexbox.md +++ b/docs/objects/Flexbox.md @@ -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 - + ``` diff --git a/docs/objects/Flexbox/setAlignItems.md b/docs/objects/Flexbox/setAlignItems.md new file mode 100644 index 0000000..454a674 --- /dev/null +++ b/docs/objects/Flexbox/setAlignItems.md @@ -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") +```