Cocos2d-x  v3.17
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Base

Copyright 2013 BlackBerry Inc. More...

Namespaces

 cocos2d
 Copyright 2013 BlackBerry Inc.
 

Classes

class  AsyncTaskPool
 This class allows to perform background operations without having to manipulate threads. More...
 
class  AutoreleasePool
 A pool for managing autorelease objects. More...
 
class  Configuration
 Configuration contains some openGL variables. More...
 
class  Controller
 A Controller object represents a connected physical game controller. More...
 
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  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 management. More...
 
class  Scheduler
 Scheduler is responsible for triggering the scheduled callbacks. More...
 
class  ScriptHandlerEntry
 This classes is wrapped to store the handler corresponding to the Lua function pointer and assign the handler a unique id. More...
 
class  SchedulerScriptHandlerEntry
 The SchedulerScriptHandlerEntry is used to store the handler corresponding to the Lua function pointer and assign the handler a unique id like ScriptHandlerEntry. More...
 
struct  BasicScriptData
 For Lua, Wrapper the script data that should be used to find the handler corresponding to the Lua function by the nativeobject pointer and store the value pointer which would be converted concretely by the different events,then the converted data would be passed into the Lua stack. More...
 
struct  ActionObjectScriptData
 For Lua, Wrapper the script data that should be used to find the handler corresponding to the Lua function by the nativeobject pointer and store the value pointer which would be converted concretely by the different events,then the converted data would be passed into the Lua stack. More...
 
struct  SchedulerScriptData
 For Lua, the SchedulerScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the elapse into the Lua stack as a parameter when scheduler update event is triggered. More...
 
struct  TouchesScriptData
 For Lua, the TouchesScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push touches data and actionType into the Lua stack as the parameters when the touches event is triggered. More...
 
struct  TouchScriptData
 For Lua, the TouchScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push touch data and actionType converted to string type into the Lua stack as the parameters when the touch event is triggered. More...
 
struct  KeypadScriptData
 For Lua, the KeypadScriptData is used to find the Lua function pointer by the nativeObject, then call the Lua function by push the actionType converted to string type into the Lua stack as the parameters when the Keypad event is triggered. More...
 
struct  CommonScriptData
 For Lua, the CommonScriptData is used to find the Lua function pointer by the handler, then call the Lua function by push the eventName, eventSource(if it not nullptr), eventSourceClassName(if it is nullptr or "", and the eventSource is not nullptr,would give the default string "cc.Ref") into the Lua stack as the parameter when the common event such as is triggered. More...
 
struct  ScriptEvent
 The ScriptEvent wrapper the different script data corresponding to the ScriptEventType in to the unified struct. More...
 
class  ScriptEngineProtocol
 Don't make ScriptEngineProtocol inherits from Object since setScriptEngine is invoked only once in AppDelegate.cpp, It will affect the lifecycle of ScriptEngine instance, the autorelease pool will be destroyed before destructing ScriptEngine. More...
 
class  ScriptEngineManager
 ScriptEngineManager is a singleton which manager an object instance of ScriptEngineProtocol, such as LuaEngine. More...
 
class  Touch
 Encapsulates the Touch information, such as touch point, id and so on, and provides the methods that commonly used. 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_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  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...
 
struct  AffineTransform
 
class  Rect
 Rectangle area. More...
 
class  Mat4
 Defines a 4 x 4 floating point matrix representing a 3D transformation. More...
 
class  MathUtil
 Defines a math utility class. More...
 
class  Quaternion
 Defines a 4-element quaternion that represents the orientation of an object in space. More...
 
class  Vec2
 Defines a 2-element floating point vector. More...
 
class  Vec3
 Defines a 3-element floating point vector. More...
 
class  Vec4
 Defines 4-element floating point vector. More...
 

Macros

#define MATH_DEG_TO_RAD(x)   ((x) * 0.0174532925f)
 Util macro for conversion from degrees to radians. More...
 
#define MATH_RAD_TO_DEG(x)   ((x)* 57.29577951f)
 Util macro for conversion from radians to degrees. More...
 

Enumerations

enum  Key
 Controllers' standard key Controller receives only standard key which contained within enum Key by default.
 
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
 Type Event type. More...
 
enum  KeyCode
 KeyCode The key (code).
 
enum  Type
 Type Event type. More...
 
enum  MouseEventType
 MouseEventType Different types of MouseEvent.
 
enum  EventCode
 EventCode Touch event code. More...
 
enum  ConfigType
 ConfigType enum. More...
 
enum  DispatchMode { , ONE_BY_ONE }
 Dispatch mode, how the touches are dispatched. More...
 
enum  TextVAlignment
 Vertical text alignment type. More...
 
enum  TextHAlignment
 Horizontal text alignment type. More...
 
enum  GlyphCollection
 Possible GlyphCollection used by Label. More...
 
enum  LabelEffect
 Effects used by Label More...
 
enum  Type {
  NONE = 0, BYTE, INTEGER, UNSIGNED,
  FLOAT, DOUBLE, BOOLEAN, STRING,
  VECTOR, MAP, INT_KEY_MAP
}
 Value type wrapped by Value. More...
 

Functions

Rect RectFromString (const std::string &str)
 Returns a Core Graphics rectangle structure corresponding to the data in a given string. More...
 
Vec2 PointFromString (const std::string &str)
 Returns a Core Graphics point structure corresponding to the data in a given string. More...
 
Size SizeFromString (const std::string &str)
 Returns a Core Graphics size structure corresponding to the data in a given string. More...
 
#define MATH_FLOAT_SMALL   1.0e-37f
 Util macro for const float such as epsilon, small float and float precision tolerance.
 

Detailed Description

Copyright 2013 BlackBerry Inc.

Copyright (c) 2014-2017 Chukong Technologies Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Original file from GamePlay3D: http://gameplay3d.org

This file was modified to fit the cocos2d-x project

Macro Definition Documentation

#define MATH_DEG_TO_RAD (   x)    ((x) * 0.0174532925f)

Util macro for conversion from degrees to radians.

var MATH_DEG_TO_RAD (   var)    ((x) * 0.0174532925f)

Util macro for conversion from degrees to radians.

local MATH_DEG_TO_RAD (   local)    ((x) * 0.0174532925f)

Util macro for conversion from degrees to radians.

#define MATH_RAD_TO_DEG (   x)    ((x)* 57.29577951f)

Util macro for conversion from radians to degrees.

var MATH_RAD_TO_DEG (   var)    ((x)* 57.29577951f)

Util macro for conversion from radians to degrees.

local MATH_RAD_TO_DEG (   local)    ((x)* 57.29577951f)

Util macro for conversion from radians to degrees.

Enumeration Type Documentation

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 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 Type
strong

Type Event type.

var Type
strong

Type Event type.

local Type
strong

Type Event type.

enum Type
strong

Type Event type.

var Type
strong

Type Event type.

local Type
strong

Type Event type.

enum EventCode
strong

EventCode Touch event code.

var EventCode
strong

EventCode Touch event code.

local EventCode
strong

EventCode Touch event code.

enum ConfigType
strong

ConfigType enum.

var ConfigType
strong

ConfigType enum.

local ConfigType
strong

ConfigType enum.

enum DispatchMode
strong

Dispatch mode, how the touches are dispatched.

Enumerator
ONE_BY_ONE 

All at once.

var DispatchMode
strong

Dispatch mode, how the touches are dispatched.

Enumerator
ONE_BY_ONE 

All at once.

local DispatchMode
strong

Dispatch mode, how the touches are dispatched.

Enumerator
ONE_BY_ONE 

All at once.

enum TextVAlignment
strong

Vertical text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
var TextVAlignment
strong

Vertical text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
local TextVAlignment
strong

Vertical text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
enum TextHAlignment
strong

Horizontal text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
var TextHAlignment
strong

Horizontal text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
local TextHAlignment
strong

Horizontal text alignment type.

Note
If any of these enums are edited and/or reordered, update Texture2D.m.
enum GlyphCollection
strong

Possible GlyphCollection used by Label.

Specify a collections of characters to be load when Label created. Consider using DYNAMIC.

var GlyphCollection
strong

Possible GlyphCollection used by Label.

Specify a collections of characters to be load when Label created. Consider using DYNAMIC.

local GlyphCollection
strong

Possible GlyphCollection used by Label.

Specify a collections of characters to be load when Label created. Consider using DYNAMIC.

enum LabelEffect
strong

Effects used by Label

var LabelEffect
strong

Effects used by Label

local LabelEffect
strong

Effects used by Label

enum Type
strong

Value type wrapped by Value.

Enumerator
NONE 

no value is wrapped, an empty Value

BYTE 

wrap byte

INTEGER 

wrap integer

UNSIGNED 

wrap unsigned

FLOAT 

wrap float

DOUBLE 

wrap double

BOOLEAN 

wrap bool

STRING 

wrap string

VECTOR 

wrap vector

MAP 

wrap ValueMap

INT_KEY_MAP 

wrap ValueMapIntKey

var Type
strong

Value type wrapped by Value.

Enumerator
NONE 

no value is wrapped, an empty Value

BYTE 

wrap byte

INTEGER 

wrap integer

UNSIGNED 

wrap unsigned

FLOAT 

wrap float

DOUBLE 

wrap double

BOOLEAN 

wrap bool

STRING 

wrap string

VECTOR 

wrap vector

MAP 

wrap ValueMap

INT_KEY_MAP 

wrap ValueMapIntKey

local Type
strong

Value type wrapped by Value.

Enumerator
NONE 

no value is wrapped, an empty Value

BYTE 

wrap byte

INTEGER 

wrap integer

UNSIGNED 

wrap unsigned

FLOAT 

wrap float

DOUBLE 

wrap double

BOOLEAN 

wrap bool

STRING 

wrap string

VECTOR 

wrap vector

MAP 

wrap ValueMap

INT_KEY_MAP 

wrap ValueMapIntKey

Function Documentation

Rect cocos2d::RectFromString ( const std::string &  str)

Returns a Core Graphics rectangle structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns Rect::ZERO.
var RectFromString ( var  str)

Returns a Core Graphics rectangle structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns Rect::ZERO.
local RectFromString ( local  str)

Returns a Core Graphics rectangle structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{{x,y},{w, h}}", where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. These components can represent integer or float values. An example of a valid string is "{{3,2},{4,5}}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a rectangle. If the string is not well-formed, the function returns Rect::ZERO.
Vec2 cocos2d::PointFromString ( const std::string &  str)

Returns a Core Graphics point structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{x,y}", where x is the x coordinate and y is the y coordinate. The x and y values can represent integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a point. If the string is not well-formed, the function returns Vec2::ZERO.
var PointFromString ( var  str)

Returns a Core Graphics point structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{x,y}", where x is the x coordinate and y is the y coordinate. The x and y values can represent integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a point. If the string is not well-formed, the function returns Vec2::ZERO.
local PointFromString ( local  str)

Returns a Core Graphics point structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{x,y}", where x is the x coordinate and y is the y coordinate. The x and y values can represent integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a point. If the string is not well-formed, the function returns Vec2::ZERO.
Size cocos2d::SizeFromString ( const std::string &  str)

Returns a Core Graphics size structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{w, h}", where w is the width and h is the height. The w and h values can be integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a size. If the string is not well-formed, the function returns Size::ZERO.
var SizeFromString ( var  str)

Returns a Core Graphics size structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{w, h}", where w is the width and h is the height. The w and h values can be integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a size. If the string is not well-formed, the function returns Size::ZERO.
local SizeFromString ( local  str)

Returns a Core Graphics size structure corresponding to the data in a given string.

Parameters
strA string object whose contents are of the form "{w, h}", where w is the width and h is the height. The w and h values can be integer or float values. An example of a valid string is "{3.0,2.5}". The string is not localized, so items are always separated with a comma.
Returns
A Core Graphics structure that represents a size. If the string is not well-formed, the function returns Size::ZERO.