---
title: SKTileDefinition
framework: spritekit
role: symbol
role_heading: Class
path: spritekit/sktiledefinition
---

# SKTileDefinition

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

## Declaration

```swift
class SKTileDefinition
```

## Overview

Overview To define the visual representation of a single tile, you create an 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 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 which is added to a SKTileSet which, in turn, is displayed in the scene with a SKTileMapNode.

## Topics

### Creating a Tile with a Texture

- [init(texture:)](spritekit/sktiledefinition/init(texture:).md)

### Creating a Tile with a Normal Texture

- [init(texture:normalTexture:size:)](spritekit/sktiledefinition/init(texture:normaltexture:size:).md)

### Creating a Tile with a Size

- [init(texture:size:)](spritekit/sktiledefinition/init(texture:size:).md)

### Creating an Animated Tile

- [init(textures:normalTextures:size:timePerFrame:)](spritekit/sktiledefinition/init(textures:normaltextures:size:timeperframe:).md)
- [init(textures:size:timePerFrame:)](spritekit/sktiledefinition/init(textures:size:timeperframe:).md)

### Flipping a Tile Vertically or Horizontally

- [flipHorizontally](spritekit/sktiledefinition/fliphorizontally.md)
- [flipVertically](spritekit/sktiledefinition/flipvertically.md)

### Rotating a Tile

- [rotation](spritekit/sktiledefinition/rotation.md)
- [SKTileDefinitionRotation](spritekit/sktiledefinitionrotation.md)

### Configure Animated Tile Properties

- [textures](spritekit/sktiledefinition/textures.md)
- [normalTextures](spritekit/sktiledefinition/normaltextures.md)
- [timePerFrame](spritekit/sktiledefinition/timeperframe.md)

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

- [userData](spritekit/sktiledefinition/userdata.md)

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

- [name](spritekit/sktiledefinition/name.md)
- [placementWeight](spritekit/sktiledefinition/placementweight.md)
- [size](spritekit/sktiledefinition/size.md)

### Initializers

- [init(coder:)](spritekit/sktiledefinition/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Tiling

- [SKTileMapNode](spritekit/sktilemapnode.md)
- [SKTileGroup](spritekit/sktilegroup.md)
- [SKTileGroupRule](spritekit/sktilegrouprule.md)
- [SKTileSet](spritekit/sktileset.md)
