Initializes a colored sprite node.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
The color for the resulting sprite node.
The size of the sprite node in points.
A newly initialized sprite node.
Although textured nodes are the most common way to use the
SKSprite class, you can also create sprite nodes without a texture. The behavior of the class changes when the node lacks a texture:
The sprite node that is returned from this method has its
textureproperty set to
There is no texture to stretch, so the
centerparameter is ignored.
There is no colorization step; the
colorproperty is used as the sprite’s color.
The sprite node's
alphacomponent is used to determine how it is blended into the buffer.
Listing 1 shows how to create a red sprite node
100 x 100 points in size.