KKStayInBoundsBehavior Class Reference
Inherits from | KKBehavior : NSObject |
Declared in | KKStayInBoundsBehavior.h |
Overview
Prevents a node’s position from passing over the bounds rectangle. (TODO: Optionally sends notifications when node comes in to contact with the bounds and when contact ends.)
Class Methods
stayInBounds:
If either x/width or y/height are set to INFINITY then that axis will not check for bounds. Thus if the node should be able to move endlessly in horizontal direction but not outside the screen at the top or bottom, set bounds.size.width or bounds.origin.x to INFINITY.
+ (id)stayInBounds:(CGRect)bounds
Parameters
- bounds
The boundary rectangle.
Return Value
An instance of the class.
Declared In
KKStayInBoundsBehavior.h