TKLayerNode Class Reference

Inherits from TKNode
Declared in TKLayerNode.h

Overview

Abstract base class for layer nodes. Layers perform the actual rendering of tilemap layers.

Refer to the concrete subclasses for more info:

Creating a Layer Node

+ nodeWithLayer:mapNode:

Creates and initializes a layer node.

+ (nonnull instancetype)nodeWithLayer:(nonnull TKLayer *)layer mapNode:(nonnull TKMapNode *)mapNode

Parameters

layer

The TKLayer whose data the layer node is supposed to draw.

mapNode

The parent TKMapNode.

Return Value

A new layer node instance.

Declared In

TKLayerNode.h

– initWithLayer:mapNode:

Initializes a layer node.

- (nonnull instancetype)initWithLayer:(nonnull TKLayer *)layer mapNode:(nonnull TKMapNode *)mapNode

Parameters

layer

The TKLayer whose data the layer node is supposed to draw.

mapNode

The parent TKMapNode.

Return Value

A new layer node instance.

Declared In

TKLayerNode.h

Accessing the Map

  mapNode

The TKMapNode object the layer node is part of.

@property (weak, readonly, nullable) TKMapNode *mapNode

Declared In

TKLayerNode.h

  map

The TKMap object the layer node’s layer is contained in.

@property (weak, readonly, nullable) TKMap *map

Declared In

TKLayerNode.h

Accessing the Layer Model

  layer

The TKLayer model object holding the layer’s data.

@property (weak, readonly, nullable) TKLayer *layer

Declared In

TKLayerNode.h

  tileLayer

The TKTileLayer model object holding the layer’s data.

@property (readonly, nullable) TKTileLayer *tileLayer

Discussion

Warning: Only valid if layer node is of class TKTileLayerNode.

Declared In

TKLayerNode.h

  objectLayer

The TKObjectLayer model object holding the layer’s data.

@property (readonly, nullable) TKObjectLayer *objectLayer

Discussion

Warning: Only valid if layer node is of class TKObjectLayerNode.

Declared In

TKLayerNode.h

  imageLayer

The TKImageLayer model object holding the layer’s data.

@property (readonly, nullable) TKImageLayer *imageLayer

Discussion

Warning: Only valid if layer node is of class TKImageLayerNode.

Declared In

TKLayerNode.h