Game Development Reference
In-Depth Information
Shadow color also takes effect only if the Shadow blur radius is greater than 0 . With
Shadow offset , you can alter the position of the shadow underneath the label. Figure 11-8
shows example shadows with a blur radius of 8 and 24 , offset slightly to the right and
down.
Figure 11-8 . Label TTF with shadows that have a blur radius of 8 (top) and 24 (bottom)
You can create rather interesting effects by combining outlines and shadows with a little
experimentation.
Adding a Credits String
Let's try adding a neat-looking credits label that you can then use to test the translation
feature. Open MainScene.ccb , and drag and drop a Label TTF node onto the stage.
Change the label's position types to % and values to 50x7 on the Item Properties tab.
As Label text , enter the following without the quotes: “Made with SpriteBuilder & Co-
cos2D”. As Font name , use the Fonts/PARPG.ttf font that you'll find by browsing into the
User Fonts section of the drop-down menu. Use a Font size of 23 . You may later want to
decrease the font size, but for now let's assume you want to optimize the label size for the
English language to see what can happen when you switch to a different localization set-
ting.
Under the Font Effects section, change the Draw Color . The actual colors aren't that im-
portant, but I'll tell you which ones I used. In the color-picker dialog, click the middle tab
of the five tabs at the top, and select Web Safe Colors from the Palette drop-down menu.
Then find the brownish color labeled CC6633 . Repeat the same for the Outline Color ,
which should be set to 330033 , and set the Shadow Color to FF9966 . The Outline width
should be set to 2 , and set the Shadow blur radius to 12 .
This should make a neat-looking label with an outline and shadow that sort of blends in
with the background. See Figure 11-9 .
Search WWH ::




Custom Search