Class cc.MoveBy

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.MoveBy(duration, deltaPos, deltaY)

Moves a CCNode object x,y pixels by modifying it's position attribute.

Method Summary

Class Detail

cc.MoveBy(duration, deltaPos, deltaY)

Moves a CCNode object x,y pixels by modifying it's position attribute.
x and y are relative to the position of the object.
Several CCMoveBy actions can be concurrently called, and the resulting
movement will be the sum of individual movements.

var actionTo = cc.moveBy(2, cc.p(windowSize.width - 40, windowSize.height - 40));
Parameters:
{Number} duration
duration in seconds
{cc.Point|Number} deltaPos
{Number} deltaY Optional

Field Detail

<static> {cc.MoveBy} cc.MoveBy.create
Please use cc.moveBy instead. Relative to its coordinate moves a certain distance.
Deprecated:
since v3.0 please use cc.moveBy instead.

Method Detail

  • {cc.MoveBy} clone()
    returns a new clone of the action
    Returns:
    {cc.MoveBy}
  • ctor(duration, deltaPos, deltaY)
    Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
    Parameters:
    {Number} duration
    duration in seconds
    {cc.Point|Number} deltaPos
    {Number} deltaY Optional
  • {Boolean} initWithDuration(duration, position, y)
    Initializes the action.
    Parameters:
    {Number} duration
    duration in seconds
    {cc.Point} position
    {Number} y Optional
    Returns:
    {Boolean}
  • {cc.MoveBy} reverse()
    MoveTo reverse is not implemented
    Returns:
    {cc.MoveBy}
  • startWithTarget(target)
    Start the action with target.
    Parameters:
    {cc.Node} target
  • update(dt)
    Called once per frame. Time is the number of seconds of a frame interval.
    Parameters:
    {Number} dt