Reinterpret a sprite's alpha property to react differently to the objects below it.
The final stage of rendering is to blend the sprite’s texture into its destination frame buffer. The default behavior uses the alpha values of the texture to blend the texture with the destination pixels. However, you can use other blend modes when you want to add other special effects to a scene.
You control the sprite’s blending behavior using the
blend property. For example, an additive blend mode is useful to combine multiple sprites together, for effects such as for fire or lighting. The following code shows how to position three overlapping sprite nodes in a circle to demonstrate the effect of different blend modes:
With the default blend mode of
SKBlend, the thee circles look like:
However, with a blend mode of
SKBlend, the color values are added together, creating a scene that looks like: