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.)

Tasks

Properties

bounds

Bounds rect in scene coordinates.

@property (nonatomic) CGRect bounds

Return Value

Bounds rect in scene coordinates.

Declared In

KKStayInBoundsBehavior.h

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