Game Development Reference
In-Depth Information
Figure 7-10 . The labels are now center-aligned
It's not possible to give a general recommendation as to which type of layout is prefer-
able—columns first, rows second as in the first example, or rows first and columns second
as in the second example. Sometimes one is easier to work with; at other times, the other
way is easier. It definitely helps if you can make all nodes involved in a grid-based layout
the same dimensions.
But, alas, with labels this is almost never possible unless you are using a fixed-width font.
Sometimes padding labels with space characters can help, though, if the alignment doesn't
have to be perfect.
Tip There's one thing you can experiment with if you need to specify the di-
mensions of a label really badly: use Button nodes in place of Label TTF ! You
can set the button's sprite frames to <NULL> in order to hide the background
sprites, and you'll still be able to change the button's size via the Preferred size
and Max size properties, as well as the label's Horizontal padding and Vertical
padding . You would end up with a label whose extents you can modify.
Changing the Slider Visuals
The default sliders look a bit dull. If you select a slider and go to the Item Properties tab,
you'll notice the CCSlider section shown in Figure 7-11 . These settings allow you to
Search WWH ::




Custom Search