KKTilemapPolyObject Class Reference
Inherits from | KKTilemapObject : NSObject |
Declared in | KKTilemapObject.h |
Overview
A polygon or polyline object. A polygon is assumed to have its last point connect with the first, the polyline does not. Though it’s up to you how you interpret that. If you need to differentiate between the two, refer to the KTTilemapObject base class' objectType property.
Tasks
-
points
property -
numberOfPoints
property -
boundingBox
property -
– updateBoundingBox
-
– makePointsFromString:
Properties
boundingBox
The polygon’s bounding box. All points of the polygon/polyline lie on or inside the boundingBox. Useful for quickly discarding collision with polygons because if the target object does not intersect with a polygon’s bounding box, it will definitely not intersect with the polygon.
@property (atomic, readonly) CGRect boundingBox
Declared In
KKTilemapObject.h
Instance Methods
makePointsFromString:
(TMX Parser Only) Creates the points array from a CGPoint encoded string where string representation of CGPoint are separated by a space character. For example: @“0,0 -80,80 -80,160 0,200 80,200”
- (void)makePointsFromString:(NSString *)string
Declared In
KKTilemapObject.h
updateBoundingBox
In cases where you manually create or change polygon points you should run updateBoundingBox to update the boundingBox property.
- (void)updateBoundingBox
Declared In
KKTilemapObject.h