Inherits from JavaScript Object

Overview

Base class of all actions that run on nodes. Actions can modify the properties of nodes to move, rotate and scale them or apply other visual effects.

An action SHOULD run only on one node. Please use action.copy() to deep clone an action if the same action will be used on another node.

Overview of Tasks

Attributes

  • Name
  • baseType

    Type flags of an action

  • isTimeReversed

    Indicates whether the internal timing for an action is reversed or not

  • typeName

    Name of an action.

  • Type
  • int
  • bool
  • string
  • Writability
  • readonly
  • readwrite
  • readonly

Functions

  • Signature
  • copy()

    Creates an deep copy of an action

  • reverse()

    Creates a reversed version of an action

  • Return Type
  • Action
  • Action

Attributes

baseType

Type flags of an action

readonly int baseType

Discussion

The value is a combination of constants defined in NamespaceActions

isTimeReversed

Indicates whether the internal timing for an action is reversed or not

readwrite bool isTimeReversed

Discussion

Default is false. This is provided as a replacement of CCReverseTimeAction defined in cocos2d-iphone

typeName

Name of an action.

Non-null readonly string typeName

Discussion

For example, aphid.g2d.actions.rotateBy(...) returns an action with name RotateByAction

Functions

copy()

Creates an deep copy of an action

Action copy()

Return Value: Action

reverse()

Creates a reversed version of an action

Action reverse()

Return Value: Action

Discussion

This method always returns a new instance of Action. A non-reversed copy is returned if there is no logical reversed version of the action, like actions.moveTo(2, new Point(100, 100)).reverse() returns the same value as actions.moveTo(2, new Point(100, 100)).copy()