Game Development Reference
In-Depth Information
Figure 7-9
.
Labels and sliders aligned in separate vertical columns
Now you still have the same problem as before: the sliders and labels are positioned too
tightly. Therefore, set the
Spacing
property to
25
for the
Box Layout
nodes named
hori-
zontalLayout
and
verticalLayoutSliders
, while
verticalLayoutLabels
should use a
Spacing
of
18
. Observe how each change affects the nodes involved.
The advantage of this setup is that it behaves a little more like auto-layout, at least consid-
ering horizontal alignment, which tends to be more important than vertical alignment. You
still have the same problem as before, but now with vertical alignment—hence, the spa-
cing of
verticalLayoutLabels
needed to be set to
18
to better align them with the sliders.
It's difficult to get the alignment correct either way when there are
Label TTF
nodes in-
volved.
Still, if you change a label's text or font size, or a slider's width, this new setup will shift
the position of the nodes in the other column accordingly. The result will be like those
shown in
Figure 7-10
. Notice the labels are now center-aligned inside their vertical
column.
Search WWH ::
Custom Search