KKTilemapObject Class Reference
Inherits from | NSObject |
Declared in | KKTilemapObject.h |
Overview
TMX “Object” - either a rectangle, open polygon (polyline) or closed polygon. Common object base class. Use the concrete subclasses KTTilemapPolyObject, KTTilemapRectangleObject or KTTilemapTileObject if you need access to each object type’s specific properties.
Note: use the objectType property (KTTilemapObjectType enum) to determine what class the object is. You can safely omit isKindOfClass and cast to the appropriate subclass.
Tasks
-
layer
property -
name
property -
type
property -
properties
property -
rotation
property -
position
property -
size
property -
objectType
property -
hidden
property -
– path
-
– rectangleObjectFromPolyObject:
-
– internal_setProperties:
Properties
hidden
NO if the object is visible, YES if it is not visible.
@property (atomic) BOOL hidden
Return Value
NO if the object is visible, YES if it is not visible.
Declared In
KKTilemapObject.h
layer
Reference to the object layer for quick access to the object’s layer.
@property (atomic, weak) KKTilemapLayer *layer
Return Value
The object layer the object is on.
Declared In
KKTilemapObject.h
name
Name of the object. TILED-EDITABLE
@property (atomic, copy) NSString *name
Declared In
KKTilemapObject.h
objectType
The type of the object, it can be either a rectangle, closed polygon, polyline or a tile. Useful for casting to the proper class without having to query isKindOfClass. DO NOT CHANGE THIS PROPERTY!
@property (atomic) KKTilemapObjectType objectType
Declared In
KKTilemapObject.h
position
The position of the object (in tile coordinates). For polygons and polylines this refers to the first point of the polygon/polyline.
@property (atomic) CGPoint position
Declared In
KKTilemapObject.h
properties
The object’s properties.
@property (atomic, readonly) KKTilemapProperties *properties
Declared In
KKTilemapObject.h
rotation
The rotation of the object (in Euler coordinates, radians).
@property (atomic) CGFloat rotation
Declared In
KKTilemapObject.h
size
The size of the object (in points). For poly objects the size is the bounding box of the polygon/polyline.
@property (atomic) CGSize size
Declared In
KKTilemapObject.h
type
The type of object assigned by the user. The type is editable in Tiled from an object’s properties dialog. The Types list in Tiled is prefilled with the Object Types added in the Tiled Preferences dialog. You can also import & export Object Types from there. Normally the type is used to identify an object defined in the objectTemplates.lua config file. TILED-EDITABLE
@property (atomic, copy) NSString *type
Declared In
KKTilemapObject.h