Contents

SKTileDefinition

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

Declaration

class SKTileDefinition

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

Creating a Tile with a Normal Texture

Creating a Tile with a Size

Creating an Animated Tile

Flipping a Tile Vertically or Horizontally

Rotating a Tile

Configure Animated Tile Properties

Reading or Adding a Tile’s Custom Data

Reading or Adjusting a Tile’s Instance Properties

Initializers

See Also

Tiling