TKObjectLayer Class Reference

Inherits from TKLayer : NSObject
Declared in TKLayer.h

Overview

Represents an object layer (aka “object group”) in a tilemap.

Working with Objects

  objects

A list of TKObject instances on this layer.

@property (readonly, nonnull) NSArray<TKObject*> *objects

Declared In

TKLayer.h

– addObject:

Adds an object.

- (void)addObject:(nonnull TKObject *)object

Parameters

object

The TKObject to add to the layer.

Declared In

TKLayer.h

– removeObject:

Removes an object. Does nothing if the layer does not contain the object.

- (void)removeObject:(nonnull TKObject *)object

Parameters

object

The TKObject to remove from the layer.

Declared In

TKLayer.h

– objectNamed:

Obtains an object by its name.

- (nullable TKObject *)objectNamed:(nonnull NSString *)name

Parameters

name

The name identifying an object.

Return Value

The first TKObject with the given name, or nil if there’s no object with this name on the layer.

Discussion

Note: Object names are case-sensitive.

Declared In

TKLayer.h

  drawOrder

Object draw order (TKObjectDrawOrder). Defaults to TKObjectDrawOrderIndex.

@property TKObjectDrawOrder drawOrder

Declared In

TKLayer.h