Game Development Reference
In-Depth Information
position to 0,0 and change Content size to use % types and 100 as the value for both width
and height. This expands the color node to fill the screen.
If you run this in the game and tap the pause button, suddenly your game view disappears.
This is because you are looking at a full-screen popover menu with a solid color back-
ground. If you prefer, you can also use a Gradient Node instead of the color node.
Tip If you notice lag due to low framerate when displaying such a full-screen
popover, simply set the visible property of the _levelNode in the back-
ground to NO . This will prevent it from being rendered behind the popover, im-
proving rendering performance.
But wait, there's more to it! In addition to a full-screen popover, you can also dim the
level view while the popover is presented. This is easily achieved by changing the color
node's Color property to black and then setting its Opacity to about 0.5 .
You can also play with the color node's Blend src and Blend dst settings to create
additional effects. Try setting Blend src to One and Blend dst to One - Dst
Color to get false colors. Try changing the color node's color and opacity, too.
Or set Blend src to One - Dst Color and Blend dst to Src Alpha Sat-
urate with Opacity set to 1 and white color to create a photo-negative effect as shown
in Figure 6-7 .
Figure 6-7 . The PauseMenuLayer presented in the game with a photo-negative effect applied by using blend
modes
Search WWH ::




Custom Search