Inherits from NSObject
Declared in KKTilemapTileProperties.h

Overview

Wrapper for tile properties, it stores one KTTilemapProperties object per tile that has properties. You can get/set KTTilemapProperties for a given tile gid by using the propertiesForGid: methods. If a gid has no properties nil will be returned. In cases where you want to create the properties of a gid use the createNonExistingProperties flag so that a new KTTilemapProperties object is created and associated with the gid if the gid has no properties yet.

Properties

count

Returns the number of property items.

@property (atomic, readonly) NSUInteger count

Declared In

KKTilemapTileProperties.h

properties

Dictionary of tile properties with gid as key (NSNumber) and values are KTTilemapProperties objects storing that tile’s properties.

@property (atomic, readonly) NSMutableDictionary *properties

Declared In

KKTilemapTileProperties.h

Instance Methods

propertiesForGid:

The gid whose properties should be returned.

- (KKTilemapProperties *)propertiesForGid:(gid_t)gid

Parameters

gid

The gid whose properties should be returned.

Return Value

the properties for a tile gid. Returns nil if the gid has no properties.

Declared In

KKTilemapTileProperties.h

propertiesForGid:createNonExistingProperties:

The gid whose properties should be returned.

- (KKTilemapProperties *)propertiesForGid:(gid_t)gid createNonExistingProperties:(BOOL)createNonExistingProperties

Parameters

gid

The gid whose properties should be returned.

createNonExistingProperties

If YES and the gid has no properties it will create a new KTTilemapProperties object, set it as the tile gid’s properties object, and return it. If createNonExistingProperties is NO behaves identical to propertiesForGid: by returning nil for non-existing tile properties.

Return Value

The properties for a tile gid.

Declared In

KKTilemapTileProperties.h

propertiesForGid:setNumber:forKey:

Sets the number for the key on the tile gid’s properties. Creates an instance of KTTilemapProperties if the gid has no properties yet.

- (KKTilemapProperties *)propertiesForGid:(gid_t)gid setNumber:(KKMutableNumber *)number forKey:(NSString *)key

Parameters

gid

The gid whose properties will be used.

number

The number to set.

key

The key uniquely identifying the number.

Return Value

The tile’s properties.

Declared In

KKTilemapTileProperties.h

propertiesForGid:setString:forKey:

Sets the string for the key on the tile gid’s properties. Creates an instance of KTTilemapProperties if the gid has no properties yet.

- (KKTilemapProperties *)propertiesForGid:(gid_t)gid setString:(NSString *)string forKey:(NSString *)key

Parameters

gid

The gid whose properties will be used.

string

The string to set.

key

The key uniquely identifying the number.

Return Value

The tile’s properties.

Declared In

KKTilemapTileProperties.h

propertiesForGid:setValue:forKey:

(KTTMXReader only) Sets a string or number (if string is convertible to number) for the key on the tile gid’s properties. Creates an instance of KTTilemapProperties if the gid has no properties yet.

- (KKTilemapProperties *)propertiesForGid:(gid_t)gid setValue:(NSString *)string forKey:(NSString *)key

Parameters

gid

The gid whose properties will be used.

string

The string to set. If the string is convertible to a number, will create a KKMutableNumber object and set that instead.

key

The key uniquely identifying the number.

Return Value

The tile’s properties.

Declared In

KKTilemapTileProperties.h