SKTiledSceneDelegate

public protocol SKTiledSceneDelegate : AnyObject

Overview

Methods for managing SKTilemap nodes in an SpriteKit SKScene scene. This protocol and the SKTiledScene objects are included as a suggested way to use the SKTilemap class, but are not required.

In this configuration, the tile map is a child of the root node and reference the custom SKTiledSceneCamera camera.

SKTiledSceneDelegate Overview

Properties

Property Description
worldNode Root container node. Tiled assets are parented to this node.
cameraNode Custom scene camera.
tilemap Tile map node.

Instance Methods

Method Description
load(tmxFile:) Load a tilemap from disk.

Available where Self: SKScene

  • Default Implementation

    Load a named TMX file, with optional tilesets.

    Declaration

    Swift

    public func load(tmxFile: String,
                     inDirectory: String? = nil,
                     withTilesets tilesets: [SKTileset] = [],
                     ignoreProperties: Bool = false,
                     loggingLevel: LoggingLevel = TiledGlobals.default.loggingLevel) -> SKTilemap?

    Parameters

    inDirectory

    String? search path for assets.

    withTilesets

    [SKTileset] optional pre-loaded tilesets.

    ignoreProperties

    Bool don’t parse custom properties.

    verbosity

    LoggingLevel logging verbosity.

    Return Value

    SKTilemap? tile map node.