Game Development Reference
In-Depth Information
Tip An Effect node without any effects can be used like a clipping node, where
any content outside the Effect node's rectangle will simply not be drawn
(clipped). You could make use of that for a split-screen view by dividing the
screen into two Effect nodes, appropriately positioned and sized. Then whatever
you draw in one Effect node will not overlap into the area of the other Effect
node.
There are many uses for this. For instance, a minimap overlay could use a large
image for the entire map, but it's added to an Effect node so that it will draw
only a small portion of the map in a corner of the screen.
In this case, the Effect node should be a full-screen effect. Select the CCEffectNode in the
Timeline, and change its position to 0x0 . Then change the Content size types to % , with
both values set to 100 . This stretches the size of the effect to the size of the screen.
Next, drag and drop the CCEffectNode in the Timeline so that it becomes the topmost
node in the list. Then drag the existing background node onto the CCEffectNode so that
the background node becomes a child node of the CCEffectNode . See the Timeline in Fig-
ure 12-8 for reference.
Figure 12-8 . Multiple effects applied to the menu background give it an entirely different look
Now any effect added to the CCEffectNode will be applied to the entire background node.
In this case, the entire MainMenuBackground.ccb will have the shader effects applied to
it, including the recently added particle effect.
Search WWH ::




Custom Search