<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "SpriteKit",
  "identifier" : "/documentation/SpriteKit/SKSpriteNode",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SpriteKit"
    ],
    "preciseIdentifier" : "c:objc(cs)SKSpriteNode"
  },
  "title" : "SKSpriteNode"
}
-->

# SKSpriteNode

An image or solid color.

```
class SKSpriteNode
```

## Overview

`SKSpriteNode` is an onscreen graphical element that can be initialized from an image or a solid color. SpriteKit adds functionality to its ability to display images using the functions discussed below.

## Topics

### Creating a Sprite from an Image Filename

Start with the basic ways to configure and use a sprite node.

[Getting Started with Sprite Nodes](/documentation/SpriteKit/getting-started-with-sprite-nodes)

Learn the basics about using images, also known as sprites, with SpriteKit.

[`init(imageNamed:)`](/documentation/SpriteKit/SKSpriteNode/init(imageNamed:))

Initializes a textured sprite using an image file.

[`init(imageNamed:normalMapped:)`](/documentation/SpriteKit/SKSpriteNode/init(imageNamed:normalMapped:))

Initializes a textured sprite using an image file, optionally adding a normal map to simulate 3D lighting.

### Creating a Sprite from a Texture

Reuse a texture across multiple sprite nodes using initializers or the setter.

[`init(texture:)`](/documentation/SpriteKit/SKSpriteNode/init(texture:))

Initializes a textured sprite using an existing texture object.

[`init(texture:color:size:)`](/documentation/SpriteKit/SKSpriteNode/init(texture:color:size:))

Initializes a textured sprite in color using an existing texture object.

[`spriteNodeWithColor:size:`](/documentation/SpriteKit/SKSpriteNode/spriteNodeWithColor:size:)

Initializes a single-color sprite.

[`spriteNodeWithImageNamed:`](/documentation/SpriteKit/SKSpriteNode/spriteNodeWithImageNamed:)

Initializes a textured sprite using an image file.

[`spriteNodeWithTexture:`](/documentation/SpriteKit/SKSpriteNode/spriteNodeWithTexture:)

Initializes a textured sprite using an existing texture object.

[`init(texture:size:)`](/documentation/SpriteKit/SKSpriteNode/init(texture:size:))

Initializes a textured sprite using an existing texture object but with a specified size.

[`init(texture:normalMap:)`](/documentation/SpriteKit/SKSpriteNode/init(texture:normalMap:))

Initializes a textured sprite with a normal map to simulate 3D lighting.

[`texture`](/documentation/SpriteKit/SKSpriteNode/texture)

The texture used to draw the sprite.

### Creating a Solid-Color Sprite

Create a colored block of any size that’s also useful for visual debugging.

[`init(color:size:)`](/documentation/SpriteKit/SKSpriteNode/init(color:size:))

Initializes a single-color sprite node.

### Initializing a Sprite from an Archive

[`init(coder:)`](/documentation/SpriteKit/SKSpriteNode/init(coder:))

Tells you when to initialize a sprite from an archive.

### Setting a Sprite’s Size and Position

Control a sprite’s onscreen placement and size.

[Using the Anchor Point to Move a Sprite](/documentation/SpriteKit/using-the-anchor-point-to-move-a-sprite)

Learn how the anchor point affects a sprite’s position.

[`size`](/documentation/SpriteKit/SKSpriteNode/size)

The dimensions of the sprite, in points.

[`scale(to:)`](/documentation/SpriteKit/SKSpriteNode/scale(to:))

Scales the sprite node to a specified size.

[`anchorPoint`](/documentation/SpriteKit/SKSpriteNode/anchorPoint)

Defines the point in the sprite that corresponds to the node’s position.

### Scaling a Sprite in Nine Parts

Resize a sprite in nine parts by defining a center rectangle.

[Resizing a Sprite in Nine Parts](/documentation/SpriteKit/resizing-a-sprite-in-nine-parts)

Scale a sprite using nine-part algorithm.

[`centerRect`](/documentation/SpriteKit/SKSpriteNode/centerRect)

Enable nine-part stretching of the sprite’s texture.

### Tinting a Sprite

Combine color and blend factor properties to colorize a textured sprite.

[Tinting a Sprite](/documentation/SpriteKit/tinting-a-sprite)

Provide a color and blend factor to additively color your sprite.

[`color`](/documentation/SpriteKit/SKSpriteNode/color)

The sprite’s color.

[`colorBlendFactor`](/documentation/SpriteKit/SKSpriteNode/colorBlendFactor)

A floating-point value that describes how the color is blended with the sprite’s texture.

### Configuring Alpha Blendling

Determine how a sprite uses an alpha value, such as additive blending, that results in the sprite being brighter than it was before.

[Blending a Sprite with Different Interpretations of Alpha](/documentation/SpriteKit/blending-a-sprite-with-different-interpretations-of-alpha)

Reinterpret a sprite’s alpha property to react differently to the objects below it.

[`blendMode`](/documentation/SpriteKit/SKSpriteNode/blendMode)

The blend mode used to draw the sprite into the parent’s framebuffer.

[`SKBlendMode`](/documentation/SpriteKit/SKBlendMode)

The modes that describe how the source and destination pixel colors are used to calculate the new destination color.

### Lighting a Sprite

Configure how a sprite is lit when it’s near a light node.

[Lighting a Sprite with Light Nodes](/documentation/SpriteKit/lighting-a-sprite-with-light-nodes)

Add lighting and shadows to your scene with light nodes.

[`lightingBitMask`](/documentation/SpriteKit/SKSpriteNode/lightingBitMask)

A mask that defines how this sprite is lit by light nodes in the scene.

[`shadowedBitMask`](/documentation/SpriteKit/SKSpriteNode/shadowedBitMask)

A mask that defines which lights add shadows to the sprite.

[`shadowCastBitMask`](/documentation/SpriteKit/SKSpriteNode/shadowCastBitMask)

A mask that defines which lights are occluded by this sprite.

[`normalTexture`](/documentation/SpriteKit/SKSpriteNode/normalTexture)

A texture that specifies the normal map for the sprite.

### Adding a Custom Shader to a Sprite

Supply a code file that does custom per-pixel rendering or colorization of a sprite.

[Applying Shaders to a Sprite](/documentation/SpriteKit/applying-shaders-to-a-sprite)

Write custom GLSL code that modifies the look of your sprite.

[`shader`](/documentation/SpriteKit/SKSpriteNode/shader)

A text file that defines code that does custom per-pixel drawing or colorization.

[`attributeValues`](/documentation/SpriteKit/SKSpriteNode/attributeValues)

The values of each attribute associated with the node’s attached shader.

[`setValue(_:forAttribute:)`](/documentation/SpriteKit/SKSpriteNode/setValue(_:forAttribute:))

Sets an attribute value for an attached shader.

[`value(forAttributeNamed:)`](/documentation/SpriteKit/SKSpriteNode/value(forAttributeNamed:))

Sets the value of a shader attribute.

### Animating a Sprite by Changing its Texture

[Animating a Sprite by Changing its Texture](/documentation/SpriteKit/animating-a-sprite-by-changing-its-texture)

Load a sequence of images and play them back at a rate you define, while optionally looping the resulting animation.

### Instance Properties

[`customPlaygroundQuickLook`](/documentation/SpriteKit/SKSpriteNode/customPlaygroundQuickLook)

A custom playground quick look for this instance.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)