Class Index | File Index

Classes


Class cc.Follow


Extends cc.Action.

Defined in: CCAction.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.Follow is an action that "follows" a node.
Field Summary
Field Attributes Field Name and Description
 
world bottomBoundary
 
world leftBoundary
 
world rightBoundary
 
world topBoundary
Method Summary
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
 
 
 
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
// 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);
Parameters:
{cc.Node} followedNode
{cc.Rect} rect
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
Parameters:
{cc.Node} followedNode
{cc.Rect} rect
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.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:51 GMT-0800 (PST)