KKFollowTargetBehavior Class Reference
Inherits from | KKBehavior : NSObject |
Declared in | KKFollowTargetBehavior.h |
Overview
Updates the owning node’s position from another node’s position, applying optional offset and/or multiplier. The multiplier can be used to achieve a parallaxing effect.
Tasks
-
target
property -
positionMultiplier
property -
positionOffset
property -
+ followTarget:
-
+ followTarget:offset:
-
+ followTarget:offset:multiplier:
Properties
positionMultiplier
The target’s position is multiplied by this position multiplier before the resulting point is set as the node’s position.
@property (atomic) CGPoint positionMultiplier
Declared In
KKFollowTargetBehavior.h
Class Methods
followTarget:
Follow another node.
+ (id)followTarget:(SKNode *)target
Parameters
- target
The node to follow.
Return Value
A new instance.
Declared In
KKFollowTargetBehavior.h
followTarget:offset:
Follow another node at an offset.
+ (id)followTarget:(SKNode *)target offset:(CGPoint)positionOffset
Parameters
- target
The node to follow.
- positionOffset
The offset to add to the target’s position.
Return Value
A new instance.
Declared In
KKFollowTargetBehavior.h
followTarget:offset:multiplier:
Follow another node at an offset with multiplier (for parallaxing effect).
+ (id)followTarget:(SKNode *)target offset:(CGPoint)positionOffset multiplier:(CGPoint)positionMultiplier
Parameters
- target
The node to follow.
- positionOffset
The offset to add to the target’s position.
- positionMultiplier
Multiply the target position by these multipliers.
Return Value
A new instance.
Declared In
KKFollowTargetBehavior.h