【Working with Other Node Types II】
An SKCropNode object does not directly render content, like a sprite node. Instead, it alters the behavior of its children when they are rendered. A crop node crops out portions of the content rendered by the children.
Listing 6-8 shows a simple use of a mask. This code loads a mask image from a texture in the app bundle. A portion of the scene’s content is then rendered, using the mask to prevent it from overdrawing the portion of the screen that the game uses to show controls.
When the crop node is rendered, the mask is rendered before the descendants are drawn. Only the alpha component of the resulting mask is relevant. Any pixel in the mask with an alpha value of 0.05 or higher is rendered. All other pixels are cropped.
【Effect Nodes Apply Special Effects to Their Descendants】
An SKEffectNode object does not draw content of its own. Instead, each time a new frame is rendered using the effect node, the effect node follows these steps:
You’ve learned a lot about the SKScene class already, but you may not have noticed that it is a subclass of SKEffectNode. This means that any scene can apply a filter to the contents. Although applying filters can be very expensive—not all filters are well designed for interactive effects—experimentation can help you find some interesting ways to use filters.
If the content of the effect node is static, you can set the node’s shouldRasterize property to YES. Setting this property causes the following changes in behavior:
Working with Other Node Types II
原文:http://www.cnblogs.com/tekkaman/p/3531834.html