Game Development Reference
In-Depth Information
Additionally, you can align the the children within the group, however, this setting
only takes effect if you also use some of the additional layout options with a
Layout
Element
component.
Finally, there are two
Child Force Expand
options (
Width
and
Height
) to force all
child elements within the group's borders to take up the maximum space possible
for each child (evenly distributing that space between its children). These settings
also override the
Maximum
settings for all child settings if you have applied
Layout Elements
(see section later in this chapter).
The default for the
Child Force Expand
settings is
on
, so keep this in
mind if you are using any of the layout options described later as it
will render some of them
invalid
.
Vertical Layout Group
With the
Vertical Layout Group
, as the name suggests we tile the child components
vertically into separate rows. Everything else is pretty much the same as the
Horizontal Layout Group
.
You can even use the same previous example, switching the
Width
and
Height
values, then using
Vertical Layout Group
instead of
Horizontal Layout Group
component, which would result in the following screenshot:
An example showing 3 sprites arranged vertically by the layout group