cocos2d-x  3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Base

@ More...

Namespaces

 cocos2d
 
 cocos2d::ui
 

Classes

class  AsyncTaskPool
 This class allows to perform background operations without having to manipulate threads. More...
 
class  AsyncTaskPool::ThreadTasks
 
class  Configuration
 Configuration contains some openGL variables. More...
 
class  Controller
 A Controller object represents a connected physical game controller. More...
 
struct  KeyStatus
 
class  Director
 Class that creates and handles the main Window and manages how and when to execute the Scenes. More...
 
class  Event
 Base class of all kinds of events. More...
 
class  EventAcceleration
 Accelerometer event. More...
 
class  EventCustom
 Custom event. More...
 
class  EventDispatcher
 This class manages event listener subscriptions and event dispatching. More...
 
class  EventDispatcher::EventListenerVector
 The vector to store event listeners with scene graph based priority and fixed priority. More...
 
class  EventFocus
 Focus event. More...
 
class  EventKeyboard
 Keyboard event. More...
 
class  EventListener
 The base class of event listener. More...
 
class  EventListenerAcceleration
 Acceleration event listener. More...
 
class  EventListenerController
 
class  EventListenerCustom
 Custom event listener. More...
 
class  EventListenerFocus
 Focus event listener. More...
 
class  EventListenerKeyboard
 Keyboard event listener. More...
 
class  EventListenerMouse
 Mouse event listener. More...
 
class  EventListenerTouchOneByOne
 Single touch event listener. More...
 
class  EventListenerTouchAllAtOnce
 Multiple touches event listener. More...
 
class  EventMouse
 The mouse event. More...
 
class  EventTouch
 Touch event. More...
 
struct  IMEKeyboardNotificationInfo
 Keyboard notification event type. More...
 
class  IMEDelegate
 Input method editor delegate. More...
 
class  IMEDispatcher
 Input Method Edit Message Dispatcher. More...
 
class  Map< K, V >
 Similar to std::unordered_map, but it will manage reference count automatically internally. More...
 
class  RandomHelper
 A helper class for creating random number. More...
 
class  Clonable
 Interface that defines how to clone an Ref. More...
 
class  Ref
 Ref is used for reference count manangement. More...
 
class  Scheduler
 Scheduler is responsible for triggering the scheduled callbacks. More...
 
struct  Color3B
 RGB color composed of bytes 3 bytes. More...
 
struct  Color4B
 RGBA color composed of 4 bytes. More...
 
struct  Color4F
 RGBA color composed of 4 floats. More...
 
struct  Tex2F
 A vertex composed of 2 floats: x, y. More...
 
struct  PointSprite
 Vec2 Sprite component. More...
 
struct  Quad2
 A 2D Quad. More...
 
struct  Quad3
 A 3D Quad. More...
 
struct  V2F_C4B_T2F
 A Vec2 with a vertex point, a tex coord point and a color 4B. More...
 
struct  V2F_C4B_PF
 
struct  V2F_C4F_T2F
 A Vec2 with a vertex point, a tex coord point and a color 4F. More...
 
struct  V3F_C4B_T2F
 A Vec2 with a vertex point, a tex coord point and a color 4B. More...
 
struct  V3F_T2F
 A Vec2 with a vertex point, a tex coord point. More...
 
struct  V2F_C4B_T2F_Triangle
 A Triangle of V2F_C4B_T2F. More...
 
struct  V2F_C4B_T2F_Quad
 A Quad of V2F_C4B_T2F. More...
 
struct  V3F_C4B_T2F_Quad
 4 Vertex3FTex2FColor4B. More...
 
struct  V2F_C4F_T2F_Quad
 4 Vertex2FTex2FColor4F Quad. More...
 
struct  V3F_T2F_Quad
 
struct  BlendFunc
 Blend Function used for textures. More...
 
struct  T2F_Quad
 Texture coordinates for a quad. More...
 
struct  AnimationFrameData
 Struct that holds the size in pixels, texture coordinates and delays for animated ParticleSystemQuad. More...
 
struct  FontShadow
 types used for defining fonts properties (i.e. More...
 
struct  FontStroke
 Stroke attributes. More...
 
struct  FontDefinition
 Font attributes. More...
 
struct  Acceleration
 The device accelerometer reports values for each axis in units of g-force. More...
 
class  UserDefault
 UserDefault acts as a tiny database. More...
 

Macros

#define CC_CALLFUNC_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_CallFunc>(&_SELECTOR)
#define CC_CALLFUNCN_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_CallFuncN>(&_SELECTOR)
#define CC_CALLFUNCND_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_CallFuncND>(&_SELECTOR)
#define CC_CALLFUNCO_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_CallFuncO>(&_SELECTOR)
#define CC_MENU_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_MenuHandler>(&_SELECTOR)
#define CC_SCHEDULE_SELECTOR(_SELECTOR)   static_cast<cocos2d::SEL_SCHEDULE>(&_SELECTOR)
#define callfunc_selector(_SELECTOR)   CC_CALLFUNC_SELECTOR(_SELECTOR)
#define callfuncN_selector(_SELECTOR)   CC_CALLFUNCN_SELECTOR(_SELECTOR)
#define callfuncND_selector(_SELECTOR)   CC_CALLFUNCND_SELECTOR(_SELECTOR)
#define callfuncO_selector(_SELECTOR)   CC_CALLFUNCO_SELECTOR(_SELECTOR)
#define menu_selector(_SELECTOR)   CC_MENU_SELECTOR(_SELECTOR)
#define schedule_selector(_SELECTOR)   CC_SCHEDULE_SELECTOR(_SELECTOR)

Typedefs

typedef void(Ref::* SEL_CallFunc )()
typedef void(Ref::* SEL_CallFuncN )(Node *)
typedef void(Ref::* SEL_CallFuncND )(Node *, void *)
typedef void(Ref::* SEL_CallFuncO )(Ref *)
typedef void(Ref::* SEL_MenuHandler )(Ref *)
typedef void(Ref::* SEL_SCHEDULE )(float)

Enumerations

enum  TaskType { TASK_IO, TASK_NETWORK, TASK_OTHER, TASK_MAX_TYPE }
 
enum  Key {
  JOYSTICK_LEFT_X = 1000, JOYSTICK_LEFT_Y, JOYSTICK_RIGHT_X, JOYSTICK_RIGHT_Y,
  BUTTON_A, BUTTON_B, BUTTON_C, BUTTON_X,
  BUTTON_Y, BUTTON_Z, BUTTON_DPAD_UP, BUTTON_DPAD_DOWN,
  BUTTON_DPAD_LEFT, BUTTON_DPAD_RIGHT, BUTTON_DPAD_CENTER, BUTTON_LEFT_SHOULDER,
  BUTTON_RIGHT_SHOULDER, AXIS_LEFT_TRIGGER, AXIS_RIGHT_TRIGGER, BUTTON_LEFT_THUMBSTICK,
  BUTTON_RIGHT_THUMBSTICK, BUTTON_START, BUTTON_SELECT, BUTTON_PAUSE,
  KEY_MAX
}
 Controllers' standard key Controller receives only standard key which contained within enum Key by default. More...
 
enum  MATRIX_STACK_TYPE { MATRIX_STACK_MODELVIEW, MATRIX_STACK_PROJECTION, MATRIX_STACK_TEXTURE }
 Matrix stack type. More...
 
enum  Projection { _2D, _3D, CUSTOM, DEFAULT = _3D }
 Possible OpenGL projections used by director. More...
 
enum  Type {
  TOUCH, KEYBOARD, ACCELERATION, MOUSE,
  FOCUS, GAME_CONTROLLER, CUSTOM
}
 Type Event type. More...
 
enum  DirtyFlag { NONE = 0, FIXED_PRIORITY = 1 << 0, SCENE_GRAPH_PRIORITY = 1 << 1, ALL = FIXED_PRIORITY | SCENE_GRAPH_PRIORITY }
 Priority dirty flag. More...
 
enum  KeyCode {
  KEY_NONE, KEY_PAUSE, KEY_SCROLL_LOCK, KEY_PRINT,
  KEY_SYSREQ, KEY_BREAK, KEY_ESCAPE, KEY_BACK = KEY_ESCAPE,
  KEY_BACKSPACE, KEY_TAB, KEY_BACK_TAB, KEY_RETURN,
  KEY_CAPS_LOCK, KEY_SHIFT, KEY_LEFT_SHIFT = KEY_SHIFT, KEY_RIGHT_SHIFT,
  KEY_CTRL, KEY_LEFT_CTRL = KEY_CTRL, KEY_RIGHT_CTRL, KEY_ALT,
  KEY_LEFT_ALT = KEY_ALT, KEY_RIGHT_ALT, KEY_MENU, KEY_HYPER,
  KEY_INSERT, KEY_HOME, KEY_PG_UP, KEY_DELETE,
  KEY_END, KEY_PG_DOWN, KEY_LEFT_ARROW, KEY_RIGHT_ARROW,
  KEY_UP_ARROW, KEY_DOWN_ARROW, KEY_NUM_LOCK, KEY_KP_PLUS,
  KEY_KP_MINUS, KEY_KP_MULTIPLY, KEY_KP_DIVIDE, KEY_KP_ENTER,
  KEY_KP_HOME, KEY_KP_UP, KEY_KP_PG_UP, KEY_KP_LEFT,
  KEY_KP_FIVE, KEY_KP_RIGHT, KEY_KP_END, KEY_KP_DOWN,
  KEY_KP_PG_DOWN, KEY_KP_INSERT, KEY_KP_DELETE, KEY_F1,
  KEY_F2, KEY_F3, KEY_F4, KEY_F5,
  KEY_F6, KEY_F7, KEY_F8, KEY_F9,
  KEY_F10, KEY_F11, KEY_F12, KEY_SPACE,
  KEY_EXCLAM, KEY_QUOTE, KEY_NUMBER, KEY_DOLLAR,
  KEY_PERCENT, KEY_CIRCUMFLEX, KEY_AMPERSAND, KEY_APOSTROPHE,
  KEY_LEFT_PARENTHESIS, KEY_RIGHT_PARENTHESIS, KEY_ASTERISK, KEY_PLUS,
  KEY_COMMA, KEY_MINUS, KEY_PERIOD, KEY_SLASH,
  KEY_0, KEY_1, KEY_2, KEY_3,
  KEY_4, KEY_5, KEY_6, KEY_7,
  KEY_8, KEY_9, KEY_COLON, KEY_SEMICOLON,
  KEY_LESS_THAN, KEY_EQUAL, KEY_GREATER_THAN, KEY_QUESTION,
  KEY_AT, KEY_CAPITAL_A, KEY_CAPITAL_B, KEY_CAPITAL_C,
  KEY_CAPITAL_D, KEY_CAPITAL_E, KEY_CAPITAL_F, KEY_CAPITAL_G,
  KEY_CAPITAL_H, KEY_CAPITAL_I, KEY_CAPITAL_J, KEY_CAPITAL_K,
  KEY_CAPITAL_L, KEY_CAPITAL_M, KEY_CAPITAL_N, KEY_CAPITAL_O,
  KEY_CAPITAL_P, KEY_CAPITAL_Q, KEY_CAPITAL_R, KEY_CAPITAL_S,
  KEY_CAPITAL_T, KEY_CAPITAL_U, KEY_CAPITAL_V, KEY_CAPITAL_W,
  KEY_CAPITAL_X, KEY_CAPITAL_Y, KEY_CAPITAL_Z, KEY_LEFT_BRACKET,
  KEY_BACK_SLASH, KEY_RIGHT_BRACKET, KEY_UNDERSCORE, KEY_GRAVE,
  KEY_A, KEY_B, KEY_C, KEY_D,
  KEY_E, KEY_F, KEY_G, KEY_H,
  KEY_I, KEY_J, KEY_K, KEY_L,
  KEY_M, KEY_N, KEY_O, KEY_P,
  KEY_Q, KEY_R, KEY_S, KEY_T,
  KEY_U, KEY_V, KEY_W, KEY_X,
  KEY_Y, KEY_Z, KEY_LEFT_BRACE, KEY_BAR,
  KEY_RIGHT_BRACE, KEY_TILDE, KEY_EURO, KEY_POUND,
  KEY_YEN, KEY_MIDDLE_DOT, KEY_SEARCH, KEY_DPAD_LEFT,
  KEY_DPAD_RIGHT, KEY_DPAD_UP, KEY_DPAD_DOWN, KEY_DPAD_CENTER,
  KEY_ENTER, KEY_PLAY
}
 KeyCode The key (code). More...
 
enum  Type {
  UNKNOWN, TOUCH_ONE_BY_ONE, TOUCH_ALL_AT_ONCE, KEYBOARD,
  MOUSE, ACCELERATION, FOCUS, GAME_CONTROLLER,
  CUSTOM
}
 Type Event type. More...
 
enum  MouseEventType {
  MOUSE_NONE, MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE,
  MOUSE_SCROLL
}
 MouseEventType Different types of MouseEvent. More...
 
enum  EventCode { BEGAN, MOVED, ENDED, CANCELLED }
 EventCode Touch event code. More...
 

Functions

template<typename T >
(T min, T max)
 Returns a random value between min and max. More...
 
template<typename T >
var  ( var min, var max)
 Returns a random value between min and max. More...
 
template<typename T >
local  ( local min, local max)
 Returns a random value between min and max. More...
 
template<>
float  (float min, float max)
template<>
local  ( local min, local max)
template<>
long double  (long double min, long double max)
template<>
var  ( var min, var max)
template<>
local  ( local min, local max)
template<>
double  (double min, double max)
template<>
var  ( var min, var max)
template<>
local  ( local min, local max)
int  ()
 Returns a random int between 0 and RAND_MAX. More...
 
void stopTasks (TaskType type)
 Stop tasks. More...
 
var stopTasks ( var type)
 Stop tasks. More...
 
local stopTasks ( local type)
 Stop tasks. More...
 
template<class F >
void enqueue (TaskType type, const TaskCallBack &callback, void *callbackParam, F &&f)
 Enqueue a asynchronous task. More...
 
template<class F >
var enqueue ( var type, var callback, var callbackParam, var f)
 Enqueue a asynchronous task. More...
 
template<class F >
local enqueue ( local type, local callback, local callbackParam, local f)
 Enqueue a asynchronous task. More...
 

Variables

const std::string CC_DLL STD_STRING_EMPTY
 A static global empty std::string install. More...
 

Detailed Description

@

Similar to std::vector, but it will manage reference count automatically internally.

This class is provide as a wrapper of basic types, such as int and bool.

Which means it will invoke Ref::retain() when adding an element, and invoke Ref::release() when removing an element. The element should be Ref or its sub-class.

Macro Definition Documentation

#define callfunc_selector (   _SELECTOR)    CC_CALLFUNC_SELECTOR(_SELECTOR)
var callfunc_selector (   var)    CC_CALLFUNC_SELECTOR(_SELECTOR)
local callfunc_selector (   local)    CC_CALLFUNC_SELECTOR(_SELECTOR)
#define callfuncN_selector (   _SELECTOR)    CC_CALLFUNCN_SELECTOR(_SELECTOR)
#define callfuncND_selector (   _SELECTOR)    CC_CALLFUNCND_SELECTOR(_SELECTOR)
var callfuncND_selector (   var)    CC_CALLFUNCND_SELECTOR(_SELECTOR)
local callfuncND_selector (   local)    CC_CALLFUNCND_SELECTOR(_SELECTOR)
#define callfuncO_selector (   _SELECTOR)    CC_CALLFUNCO_SELECTOR(_SELECTOR)
var callfuncO_selector (   var)    CC_CALLFUNCO_SELECTOR(_SELECTOR)
local callfuncO_selector (   local)    CC_CALLFUNCO_SELECTOR(_SELECTOR)
#define CC_CALLFUNC_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_CallFunc>(&_SELECTOR)
var CC_CALLFUNC_SELECTOR (   var)    static_cast<cocos2d::SEL_CallFunc>(&_SELECTOR)
local CC_CALLFUNC_SELECTOR (   local)    static_cast<cocos2d::SEL_CallFunc>(&_SELECTOR)
#define CC_CALLFUNCN_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_CallFuncN>(&_SELECTOR)
var CC_CALLFUNCN_SELECTOR (   var)    static_cast<cocos2d::SEL_CallFuncN>(&_SELECTOR)
local CC_CALLFUNCN_SELECTOR (   local)    static_cast<cocos2d::SEL_CallFuncN>(&_SELECTOR)
#define CC_CALLFUNCND_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_CallFuncND>(&_SELECTOR)
var CC_CALLFUNCND_SELECTOR (   var)    static_cast<cocos2d::SEL_CallFuncND>(&_SELECTOR)
#define CC_CALLFUNCO_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_CallFuncO>(&_SELECTOR)
#define CC_MENU_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_MenuHandler>(&_SELECTOR)
#define CC_SCHEDULE_SELECTOR (   _SELECTOR)    static_cast<cocos2d::SEL_SCHEDULE>(&_SELECTOR)
var CC_SCHEDULE_SELECTOR (   var)    static_cast<cocos2d::SEL_SCHEDULE>(&_SELECTOR)
local CC_SCHEDULE_SELECTOR (   local)    static_cast<cocos2d::SEL_SCHEDULE>(&_SELECTOR)
#define menu_selector (   _SELECTOR)    CC_MENU_SELECTOR(_SELECTOR)
var menu_selector (   var)    CC_MENU_SELECTOR(_SELECTOR)
local menu_selector (   local)    CC_MENU_SELECTOR(_SELECTOR)
#define schedule_selector (   _SELECTOR)    CC_SCHEDULE_SELECTOR(_SELECTOR)
var schedule_selector (   var)    CC_SCHEDULE_SELECTOR(_SELECTOR)
local schedule_selector (   local)    CC_SCHEDULE_SELECTOR(_SELECTOR)

Typedef Documentation

typedef void(Ref::* SEL_CallFunc)()
typedef void(Ref::* SEL_CallFunc)()
typedef void(Ref::* SEL_CallFunc)()
typedef void(Ref::*
SEL_CallFuncN)(Node *)
typedef void(Ref::*
SEL_CallFuncN)(Node *)
typedef void(Ref::*
SEL_CallFuncN)(Node *)
typedef void(Ref::*
SEL_CallFuncND)(Node *, void *)
typedef void(Ref::*
SEL_CallFuncND)(Node *, void *)
typedef void(Ref::*
SEL_CallFuncND)(Node *, void *)
typedef void(Ref::*
SEL_CallFuncO)(Ref *)
typedef void(Ref::*
SEL_CallFuncO)(Ref *)
typedef void(Ref::*
SEL_CallFuncO)(Ref *)
typedef void(Ref::*
SEL_MenuHandler)(Ref *)
typedef void(Ref::*
SEL_MenuHandler)(Ref *)
typedef void(Ref::*
SEL_MenuHandler)(Ref *)
typedef void(Ref::*
SEL_SCHEDULE)(float)
typedef void(Ref::*
SEL_SCHEDULE)(float)
typedef void(Ref::*
SEL_SCHEDULE)(float)

Enumeration Type Documentation

enum DirtyFlag
strongprotected

Priority dirty flag.

Enumerator
NONE 
FIXED_PRIORITY 
SCENE_GRAPH_PRIORITY 
ALL 
var DirtyFlag
strongprotected

Priority dirty flag.

Enumerator
NONE 
FIXED_PRIORITY 
SCENE_GRAPH_PRIORITY 
ALL 
local DirtyFlag
strongprotected

Priority dirty flag.

Enumerator
NONE 
FIXED_PRIORITY 
SCENE_GRAPH_PRIORITY 
ALL 
enum EventCode
strong

EventCode Touch event code.

Enumerator
BEGAN 
MOVED 
ENDED 
CANCELLED 
var EventCode
strong

EventCode Touch event code.

Enumerator
BEGAN 
MOVED 
ENDED 
CANCELLED 
local EventCode
strong

EventCode Touch event code.

Enumerator
BEGAN 
MOVED 
ENDED 
CANCELLED 
enum Key

Controllers' standard key Controller receives only standard key which contained within enum Key by default.

Enumerator
JOYSTICK_LEFT_X 
JOYSTICK_LEFT_Y 
JOYSTICK_RIGHT_X 
JOYSTICK_RIGHT_Y 
BUTTON_A 
BUTTON_B 
BUTTON_C 
BUTTON_X 
BUTTON_Y 
BUTTON_Z 
BUTTON_DPAD_UP 
BUTTON_DPAD_DOWN 
BUTTON_DPAD_LEFT 
BUTTON_DPAD_RIGHT 
BUTTON_DPAD_CENTER 
BUTTON_LEFT_SHOULDER 
BUTTON_RIGHT_SHOULDER 
AXIS_LEFT_TRIGGER 
AXIS_RIGHT_TRIGGER 
BUTTON_LEFT_THUMBSTICK 
BUTTON_RIGHT_THUMBSTICK 
BUTTON_START 
BUTTON_SELECT 
BUTTON_PAUSE 
KEY_MAX 
var Key

Controllers' standard key Controller receives only standard key which contained within enum Key by default.

Enumerator
JOYSTICK_LEFT_X 
JOYSTICK_LEFT_Y 
JOYSTICK_RIGHT_X 
JOYSTICK_RIGHT_Y 
BUTTON_A 
BUTTON_B 
BUTTON_C 
BUTTON_X 
BUTTON_Y 
BUTTON_Z 
BUTTON_DPAD_UP 
BUTTON_DPAD_DOWN 
BUTTON_DPAD_LEFT 
BUTTON_DPAD_RIGHT 
BUTTON_DPAD_CENTER 
BUTTON_LEFT_SHOULDER 
BUTTON_RIGHT_SHOULDER 
AXIS_LEFT_TRIGGER 
AXIS_RIGHT_TRIGGER 
BUTTON_LEFT_THUMBSTICK 
BUTTON_RIGHT_THUMBSTICK 
BUTTON_START 
BUTTON_SELECT 
BUTTON_PAUSE 
KEY_MAX 
local Key

Controllers' standard key Controller receives only standard key which contained within enum Key by default.

Enumerator
JOYSTICK_LEFT_X 
JOYSTICK_LEFT_Y 
JOYSTICK_RIGHT_X 
JOYSTICK_RIGHT_Y 
BUTTON_A 
BUTTON_B 
BUTTON_C 
BUTTON_X 
BUTTON_Y 
BUTTON_Z 
BUTTON_DPAD_UP 
BUTTON_DPAD_DOWN 
BUTTON_DPAD_LEFT 
BUTTON_DPAD_RIGHT 
BUTTON_DPAD_CENTER 
BUTTON_LEFT_SHOULDER 
BUTTON_RIGHT_SHOULDER 
AXIS_LEFT_TRIGGER 
AXIS_RIGHT_TRIGGER 
BUTTON_LEFT_THUMBSTICK 
BUTTON_RIGHT_THUMBSTICK 
BUTTON_START 
BUTTON_SELECT 
BUTTON_PAUSE 
KEY_MAX 
enum KeyCode
strong

KeyCode The key (code).

Enumerator
KEY_NONE 
KEY_PAUSE 
KEY_SCROLL_LOCK 
KEY_PRINT 
KEY_SYSREQ 
KEY_BREAK 
KEY_ESCAPE 
KEY_BACK 
KEY_BACKSPACE 
KEY_TAB 
KEY_BACK_TAB 
KEY_RETURN 
KEY_CAPS_LOCK 
KEY_SHIFT 
KEY_LEFT_SHIFT 
KEY_RIGHT_SHIFT 
KEY_CTRL 
KEY_LEFT_CTRL 
KEY_RIGHT_CTRL 
KEY_ALT 
KEY_LEFT_ALT 
KEY_RIGHT_ALT 
KEY_MENU 
KEY_HYPER 
KEY_INSERT 
KEY_HOME 
KEY_PG_UP 
KEY_DELETE 
KEY_END 
KEY_PG_DOWN 
KEY_LEFT_ARROW 
KEY_RIGHT_ARROW 
KEY_UP_ARROW 
KEY_DOWN_ARROW 
KEY_NUM_LOCK 
KEY_KP_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EY_T 
KEY_U 
KEY_V 
KEY_W 
KEY_X 
KEY_Y 
KEY_Z 
KEY_LEFT_BRACE 
KEY_BAR 
KEY_RIGHT_BRACE 
KEY_TILDE 
KEY_EURO 
KEY_POUND 
KEY_YEN 
KEY_MIDDLE_DOT 
KEY_SEARCH 
KEY_DPAD_LEFT 
KEY_DPAD_RIGHT 
KEY_DPAD_UP 
KEY_DPAD_DOWN 
KEY_DPAD_CENTER 
KEY_ENTER 
KEY_PLAY 
enum MATRIX_STACK_TYPE
strong

Matrix stack type.

Enumerator
MATRIX_STACK_MODELVIEW 

Model view matrix stack.

MATRIX_STACK_PROJECTION 

projection matrix stack

MATRIX_STACK_TEXTURE 

texture matrix stack

var MATRIX_STACK_TYPE
strong

Matrix stack type.

Enumerator
MATRIX_STACK_MODELVIEW 

Model view matrix stack.

MATRIX_STACK_PROJECTION 

projection matrix stack

MATRIX_STACK_TEXTURE 

texture matrix stack

local MATRIX_STACK_TYPE
strong

Matrix stack type.

Enumerator
MATRIX_STACK_MODELVIEW 

Model view matrix stack.

MATRIX_STACK_PROJECTION 

projection matrix stack

MATRIX_STACK_TEXTURE 

texture matrix stack

enum MouseEventType
strong

MouseEventType Different types of MouseEvent.

Enumerator
MOUSE_NONE 
MOUSE_DOWN 
MOUSE_UP 
MOUSE_MOVE 
MOUSE_SCROLL 
var MouseEventType
strong

MouseEventType Different types of MouseEvent.

Enumerator
MOUSE_NONE 
MOUSE_DOWN 
MOUSE_UP 
MOUSE_MOVE 
MOUSE_SCROLL 
local MouseEventType
strong

MouseEventType Different types of MouseEvent.

Enumerator
MOUSE_NONE 
MOUSE_DOWN 
MOUSE_UP 
MOUSE_MOVE 
MOUSE_SCROLL 
enum Projection
strong

Possible OpenGL projections used by director.

Enumerator
_2D 

Sets a 2D projection (orthogonal projection).

_3D 

Sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.

CUSTOM 

It calls "updateProjection" on the projection delegate.

DEFAULT 

Default projection is 3D projection.

var Projection
strong

Possible OpenGL projections used by director.

Enumerator
_2D 

Sets a 2D projection (orthogonal projection).

_3D 

Sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.

CUSTOM 

It calls "updateProjection" on the projection delegate.

DEFAULT 

Default projection is 3D projection.

local Projection
strong

Possible OpenGL projections used by director.

Enumerator
_2D 

Sets a 2D projection (orthogonal projection).

_3D 

Sets a 3D projection with a fovy=60, znear=0.5f and zfar=1500.

CUSTOM 

It calls "updateProjection" on the projection delegate.

DEFAULT 

Default projection is 3D projection.

enum TaskType
strong
Enumerator
TASK_IO 
TASK_NETWORK 
TASK_OTHER 
TASK_MAX_TYPE 
var TaskType
strong
Enumerator
TASK_IO 
TASK_NETWORK 
TASK_OTHER 
TASK_MAX_TYPE 
local TaskType
strong
Enumerator
TASK_IO 
TASK_NETWORK 
TASK_OTHER 
TASK_MAX_TYPE 
enum Type
strong

Type Event type.

Enumerator
TOUCH 
KEYBOARD 
ACCELERATION 
MOUSE 
FOCUS 
GAME_CONTROLLER 
CUSTOM 
var Type
strong

Type Event type.

Enumerator
TOUCH 
KEYBOARD 
ACCELERATION 
MOUSE 
FOCUS 
GAME_CONTROLLER 
CUSTOM 
local Type
strong

Type Event type.

Enumerator
TOUCH 
KEYBOARD 
ACCELERATION 
MOUSE 
FOCUS 
GAME_CONTROLLER 
CUSTOM 
enum Type
strong

Type Event type.

Enumerator
UNKNOWN 
TOUCH_ONE_BY_ONE 
TOUCH_ALL_AT_ONCE 
KEYBOARD 
MOUSE 
ACCELERATION 
FOCUS 
GAME_CONTROLLER 
CUSTOM 
var Type
strong

Type Event type.

Enumerator
UNKNOWN 
TOUCH_ONE_BY_ONE 
TOUCH_ALL_AT_ONCE 
KEYBOARD 
MOUSE 
ACCELERATION 
FOCUS 
GAME_CONTROLLER 
CUSTOM 
local Type
strong

Type Event type.

Enumerator
UNKNOWN 
TOUCH_ONE_BY_ONE 
TOUCH_ALL_AT_ONCE 
KEYBOARD 
MOUSE 
ACCELERATION 
FOCUS 
GAME_CONTROLLER 
CUSTOM 

Function Documentation

T cocos2d::random ( min,
max 
)
inline

Returns a random value between min and max.

var random ( var  min,
var  max 
)
inline

Returns a random value between min and max.

local random ( local  min,
local  max 
)
inline

Returns a random value between min and max.

float cocos2d::random ( float  min,
float  max 
)
inline
var random ( var  min,
var  max 
)
inline
local random ( local  min,
local  max 
)
inline
long double cocos2d::random ( long double  min,
long double  max 
)
inline
var random ( var  min,
var  max 
)
inline
local random ( local  min,
local  max 
)
inline
double cocos2d::random ( double  min,
double  max 
)
inline
var random ( var  min,
var  max 
)
inline
local random ( local  min,
local  max 
)
inline
int cocos2d::random ( )
inline

Returns a random int between 0 and RAND_MAX.

var random ( )
inline

Returns a random int between 0 and RAND_MAX.

local random ( )
inline

Returns a random int between 0 and RAND_MAX.

void enqueue ( AsyncTaskPool::TaskType  type,
const TaskCallBack callback,
void *  callbackParam,
F &&  f 
)
inline

Enqueue a asynchronous task.

Parameters
typetask type is io task, network task or others, each type of task has a thread to deal with it.
callbackcallback when the task is finished. The callback is called in the main thread instead of task thread.
callbackParamparameter used by the callback.
ftask can be lambda function.
argstask parameters.
var enqueue ( var  type,
var  callback,
var  callbackParam,
var  f 
)
inline

Enqueue a asynchronous task.

Parameters
typetask type is io task, network task or others, each type of task has a thread to deal with it.
callbackcallback when the task is finished. The callback is called in the main thread instead of task thread.
callbackParamparameter used by the callback.
ftask can be lambda function.
argstask parameters.
local enqueue ( local  type,
local  callback,
local  callbackParam,
local  f 
)
inline

Enqueue a asynchronous task.

Parameters
typetask type is io task, network task or others, each type of task has a thread to deal with it.
callbackcallback when the task is finished. The callback is called in the main thread instead of task thread.
callbackParamparameter used by the callback.
ftask can be lambda function.
argstask parameters.
void stopTasks ( TaskType  type)
inline

Stop tasks.

Parameters
typeTask type you want to stop.
var stopTasks ( var  type)
inline

Stop tasks.

Parameters
typeTask type you want to stop.
local stopTasks ( local  type)
inline

Stop tasks.

Parameters
typeTask type you want to stop.

Variable Documentation

const std::string CC_DLL
STD_STRING_EMPTY

A static global empty std::string install.

var STD_STRING_EMPTY

A static global empty std::string install.

local STD_STRING_EMPTY

A static global empty std::string install.