Game Development Reference
In-Depth Information
the content size values in Figure 3-10 , where I set the layer sizes to 1000x415, 2000x450,
and 3000x480, respectively.
Tip You could also create a CCB file of type Node and use those as parallax
layers. I added them to the same CCB because it's mainly static content that is
not being re-used for other backgrounds, and it makes it easier to see each lay-
er's relative size.
When you select each layer node, its selection rectangle will show you the size of the
background layer. Nodes added to a layer must be within this area to be seen in the game.
However, the selection rectangle goes away as soon as you select another node. To per-
manently see the layer's size visually while adding nodes to it, you should drag and drop a
color node onto each layer node in the Timeline. Each color node should be a child of one
layer node. If, after dropping, the color node didn't become a layer's child, simply drag it
in the Timeline View and drop it onto a layer node. The result should look like that shown
in Figure 3-10 .
Perform the following steps for each color node in sequence:
1.
Set the Content size type to % .. in percent of parent container for both
width and height.
2.
Set the Content size width and height to 100% to expand the color node to its
parent layer's size.
3.
Set the color node's Opacity property to a low value like 0.1 to better see the
nodes of other layers behind it.
4.
Change the color property to a color of your choice.
Figure 3-11 shows the Item Properties of one color node; its properties are representative
of all three color nodes.
Search WWH ::




Custom Search