Class cc.Follow
Extends
cc.Action.
Defined in: CCAction.js.
Constructor Attributes | Constructor Name and Description |
---|---|
cc.Follow is an action that "follows" a node.
|
Field Attributes | Field Name and Description |
---|---|
world bottomBoundary
|
|
world leftBoundary
|
|
world rightBoundary
|
|
world topBoundary
|
Method Attributes | Method Name and Description |
---|---|
<static> |
cc.Follow.create(followedNode, rect)
creates the action with a set boundary
creates the action with no boundary set |
initWithTarget(followedNode, rect)
initializes the action
initializes the action with a set boundary
|
|
isDone()
|
|
setBoudarySet(value)
alter behavior - turn on/off boundary
|
|
step(dt)
|
|
stop()
Stop the action.
|
- Methods borrowed from class cc.Action:
- copy, copyWithZone, description, getOriginalTarget, getTag, getTarget, release, retain, setOriginalTarget, setTag, setTarget, startWithTarget, update
Class Detail
cc.Follow()
cc.Follow is an action that "follows" a node.
//example //Instead of using cc.Camera as a "follower", use this action instead. layer.runAction(cc.Follow.actionWithTarget(hero));
Field Detail
bottomBoundary
world bottomBoundary
leftBoundary
world leftBoundary
rightBoundary
world rightBoundary
topBoundary
world topBoundary
Method Detail
<static>
{cc.Follow|Null}
cc.Follow.create(followedNode, rect)
creates the action with a set boundary
creates the action with no boundary set
creates the action with no boundary set
// example // creates the action with a set boundary var sprite = cc.Sprite.create("spriteFileName"); var followAction = cc.Follow.create(sprite, cc.rect(0, 0, s.width * 2 - 100, s.height)); this.runAction(followAction); // creates the action with no boundary set var sprite = cc.Sprite.create("spriteFileName"); var followAction = cc.Follow.create(sprite); this.runAction(followAction);
- Returns:
- {cc.Follow|Null} returns the cc.Follow object on success
{Boolean}
initWithTarget(followedNode, rect)
initializes the action
initializes the action with a set boundary
- Returns:
- {Boolean}
{Boolean}
isBoundarySet()
- Returns:
- {Boolean}
{Boolean}
isDone()
- Returns:
- {Boolean}
setBoudarySet(value)
alter behavior - turn on/off boundary
- Parameters:
- {Boolean} value
step(dt)
- Parameters:
- {Number} dt
stop()
Stop the action.