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

# SKTileDefinition

A single tile that can be repeated in a tile map.

```
class SKTileDefinition
```

## Overview

To define the visual representation of a single tile, you create an [`SKTileDefinition`](/documentation/SpriteKit/SKTileDefinition) object with texture and size information. Tile definitions support separate normal textures, for simulating 3D lighting, and arrays of textures for animation with speed controlled by the [`timePerFrame`](/documentation/SpriteKit/SKTileDefinition/timePerFrame) property. Textures can be rotated in 90˚ increments or flipped either vertically or horizontally.

Once a tile definition has been created, you encapsulate it in a [`SKTileGroup`](/documentation/SpriteKit/SKTileGroup) which is added to a [`SKTileSet`](/documentation/SpriteKit/SKTileSet) which, in turn, is displayed in the scene with a [`SKTileMapNode`](/documentation/SpriteKit/SKTileMapNode).

## Topics

### Creating a Tile with a Texture

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

Initializes a new tile definition with a single texture.

[`tileDefinitionWithTexture:`](/documentation/SpriteKit/SKTileDefinition/tileDefinitionWithTexture:)

### Creating a Tile with a Normal Texture

Create a tile with an additional texture that’s used for lighting effects.

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

Initializes a new tile definition with a single texture and separate normal texture for simulating 3D lighting.

[`tileDefinitionWithTexture:normalTexture:size:`](/documentation/SpriteKit/SKTileDefinition/tileDefinitionWithTexture:normalTexture:size:)

### Creating a Tile with a Size

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

Initializes a new tile definition of a specified size with a single texture.

[`tileDefinitionWithTexture:size:`](/documentation/SpriteKit/SKTileDefinition/tileDefinitionWithTexture:size:)

### Creating an Animated Tile

Create an animated Tile by passing in an array of textures (animation frames) and their respective times per frame.

[`init(textures:normalTextures:size:timePerFrame:)`](/documentation/SpriteKit/SKTileDefinition/init(textures:normalTextures:size:timePerFrame:))

Initializes a new tile definition with arrays of textures and normal textures for animation.

[`tileDefinitionWithTextures:normalTextures:size:timePerFrame:`](/documentation/SpriteKit/SKTileDefinition/tileDefinitionWithTextures:normalTextures:size:timePerFrame:)

[`init(textures:size:timePerFrame:)`](/documentation/SpriteKit/SKTileDefinition/init(textures:size:timePerFrame:))

Initializes a new tile definition with an array of textures for animation.

[`tileDefinitionWithTextures:size:timePerFrame:`](/documentation/SpriteKit/SKTileDefinition/tileDefinitionWithTextures:size:timePerFrame:)

### Flipping a Tile Vertically or Horizontally

[`flipHorizontally`](/documentation/SpriteKit/SKTileDefinition/flipHorizontally)

A Boolean that flips the definition’s image vertically.

[`flipVertically`](/documentation/SpriteKit/SKTileDefinition/flipVertically)

A Boolean that flips the definition’s image horizontally.

### Rotating a Tile

[`rotation`](/documentation/SpriteKit/SKTileDefinition/rotation)

The rotation of the tile definition in 90˚ increments.

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

The allowed rotations for a given tile.

### Configure Animated Tile Properties

[`textures`](/documentation/SpriteKit/SKTileDefinition/textures)

An array of [`SKTexture`](/documentation/SpriteKit/SKTexture) objects that defines the tile definition object’s content.

[`normalTextures`](/documentation/SpriteKit/SKTileDefinition/normalTextures)

An array of [`SKTexture`](/documentation/SpriteKit/SKTexture) objects used to generate the normals for the tile to simulate 3D lighting.

[`timePerFrame`](/documentation/SpriteKit/SKTileDefinition/timePerFrame)

The duration, in seconds, that each texture in the textures array is displayed before switching to the next texture in the sequence.

### Reading or Adding a Tile’s Custom Data

[`userData`](/documentation/SpriteKit/SKTileDefinition/userData)

A dictionary containing arbitrary data.

### Reading or Adjusting a Tile’s Instance Properties

[`name`](/documentation/SpriteKit/SKTileDefinition/name)

A name associated with the tile definition.

[`placementWeight`](/documentation/SpriteKit/SKTileDefinition/placementWeight)

The placement weight of the tile definition.

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

The size of the tile definition in points.



---

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)