Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
2D Nodes

Namespaces

 cocos2d::DrawPrimitives
 IMPORTANT! IMPORTANT! IMPORTANT! IMPORTANT!
 

Classes

class  AnimationFrame
 A frame of the animation. More...
 
struct  AnimationFrame::DisplayedEventInfo
 When the animation display,Dispatches the event of UserData. More...
 
class  Animation
 A Animation object is used to perform animations on the Sprite objects. More...
 
class  AnimationCache
 Singleton that manages the Animations. More...
 
class  AtlasNode
 AtlasNode is a subclass of Node that implements the RGBAProtocol and TextureProtocol protocol. More...
 
class  PolygonInfo
 PolygonInfo is an object holding the required data to display Sprites。 It can be a simple as a triangle, or as complex as a whole 3D mesh. More...
 
class  AutoPolygon
 AutoPolygon is a helper Object AutoPolygon's purpose is to process an image into 2d polygon mesh in runtime It has functions for each step in the process, from tracing all the points, to triangulation the result can be then passed to Sprite::create() to create a Polygon Sprite. More...
 
class  ClippingNode
 ClippingNode is a subclass of Node. More...
 
class  ClippingRectangleNode
 Clipping Rectangle Node. More...
 
class  DrawNode
 Node that draws dots, segments and polygons. More...
 
class  TMXLayer
 FastTMXLayer represents the TMX layer. More...
 
class  TMXTiledMap
 FastTMXTiledMap knows how to parse and render a TMX map. More...
 
class  Grabber
 FBO class that grabs the the contents of the screen. More...
 
class  GridBase
 Base class for Other grid. More...
 
class  Grid3D
 Grid3D is a 3D grid implementation. More...
 
class  TiledGrid3D
 TiledGrid3D is a 3D grid implementation. More...
 
class  Label
 Label is a subclass of Node that knows how to render text labels. More...
 
class  LabelAtlas
 LabelAtlas is a subclass of AtlasNode. More...
 
class  Layer
 Layer is a subclass of Node that implements the TouchEventsDelegate protocol. More...
 
class  LayerColor
 LayerColor is a subclass of Layer that implements the RGBAProtocol protocol. More...
 
class  LayerGradient
 LayerGradient is a subclass of LayerColor that draws gradients across the background. More...
 
class  LayerMultiplex
 MultipleLayer is a Layer with the ability to multiplex it's children. More...
 
class  BaseLight
 BaseLight is the parent of all the lights. More...
 
class  DirectionLight
 DirectionLight simulates light that is being emitted from a source that is infinitely far away. More...
 
class  PointLight
 Point light has a position, and sends rays in all directions. More...
 
class  SpotLight
 Spot light is a special light that all light rays are restricted to a cone of light. More...
 
class  AmbientLight
 Ambient light simulates the light in the enviorment, it emits to all direction with the same intensity. More...
 
class  Menu
 A Menu for touch handling. More...
 
class  MenuItem
 MenuItem base class. More...
 
class  MenuItemLabel
 An base class for "label" MenuItemLabel items. More...
 
class  MenuItemAtlasFont
 Helper class that creates a MenuItemLabel class with a LabelAtlas. More...
 
class  MenuItemFont
 A MenuItemFont. More...
 
class  MenuItemSprite
 MenuItemSprite accepts Node<RGBAProtocol> objects as displayed items. More...
 
class  MenuItemImage
 MenuItemImage accepts images as displayed items. More...
 
class  MenuItemToggle
 A MenuItemToggle. More...
 
class  MotionStreak
 Creates a trailing path. More...
 
class  Node
 Node is the base element of the Scene Graph. More...
 
class  NodeGrid
 Base class for Grid Node,the grid action's management class. More...
 
class  ParallaxNode
 ParallaxNode: A node that simulates a parallax scroller. More...
 
class  ParticleBatchNode
 ParticleBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"). More...
 
class  ParticleFire
 A fire particle system. More...
 
class  ParticleFireworks
 A fireworks particle system. More...
 
class  ParticleSun
 A sun particle system. More...
 
class  ParticleGalaxy
 A galaxy particle system. More...
 
class  ParticleFlower
 A flower particle system. More...
 
class  ParticleMeteor
 A meteor particle system. More...
 
class  ParticleSpiral
 An spiral particle system. More...
 
class  ParticleExplosion
 An explosion particle system. More...
 
class  ParticleSmoke
 An smoke particle system. More...
 
class  ParticleSnow
 An snow particle system. More...
 
class  ParticleRain
 A rain particle system. More...
 
class  ParticleSystemQuad
 ParticleSystemQuad is a subclass of ParticleSystem. More...
 
class  ProgressTimer
 ProgressTimer is a subclass of Node. More...
 
class  ProtectedNode
 A inner node type mainly used for UI module. More...
 
class  RenderTexture
 RenderTexture is a generic rendering target. More...
 
class  Scene
 Scene is a subclass of Node that is used only as an abstract concept. More...
 
class  Sprite
 Sprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) ). More...
 
class  SpriteBatchNode
 SpriteBatchNode is like a batch node: if it contains children, it will draw them in 1 single OpenGL call (often known as "batch draw"). More...
 
class  SpriteFrame
 A SpriteFrame has: More...
 
class  SpriteFrameCache
 Singleton that handles the loading of the sprite frames. More...
 
class  TMXObjectGroup
 TMXObjectGroup represents the TMX object group. More...
 
class  TransitionEaseScene
 TransitionEaseScene can ease the actions of the scene protocol. More...
 
class  TransitionScene
 Base class for Transition scenes. More...
 
class  TransitionSceneOriented
 A Transition that supports orientation like. More...
 
class  TransitionRotoZoom
 TransitionRotoZoom: Rotate and zoom out the outgoing scene, and then rotate and zoom in the incoming. More...
 
class  TransitionJumpZoom
 TransitionJumpZoom: Zoom out and jump the outgoing scene, and then jump and zoom in the incoming. More...
 
class  TransitionMoveInL
 TransitionMoveInL: Move in from to the left the incoming scene. More...
 
class  TransitionMoveInR
 TransitionMoveInR: Move in from to the right the incoming scene. More...
 
class  TransitionMoveInT
 TransitionMoveInT: Move in from to the top the incoming scene. More...
 
class  TransitionMoveInB
 TransitionMoveInB: Move in from to the bottom the incoming scene. More...
 
class  TransitionSlideInL
 TransitionSlideInL: Slide in the incoming scene from the left border. More...
 
class  TransitionSlideInR
 TransitionSlideInR: Slide in the incoming scene from the right border. More...
 
class  TransitionSlideInB
 TransitionSlideInB: Slide in the incoming scene from the bottom border. More...
 
class  TransitionSlideInT
 TransitionSlideInT: Slide in the incoming scene from the top border. More...
 
class  TransitionShrinkGrow
 Shrink the outgoing scene while grow the incoming scene. More...
 
class  TransitionFlipX
 TransitionFlipX: Flips the screen horizontally. More...
 
class  TransitionFlipY
 TransitionFlipY: Flips the screen vertically. More...
 
class  TransitionFlipAngular
 TransitionFlipAngular: Flips the screen half horizontally and half vertically. More...
 
class  TransitionZoomFlipX
 TransitionZoomFlipX: Flips the screen horizontally doing a zoom out/in The front face is the outgoing scene and the back face is the incoming scene. More...
 
class  TransitionZoomFlipY
 TransitionZoomFlipY: Flips the screen vertically doing a little zooming out/in The front face is the outgoing scene and the back face is the incoming scene. More...
 
class  TransitionZoomFlipAngular
 TransitionZoomFlipAngular: Flips the screen half horizontally and half vertically doing a little zooming out/in. More...
 
class  TransitionFade
 TransitionFade: Fade out the outgoing scene and then fade in the incoming scene. More...
 
class  TransitionCrossFade
 TransitionCrossFade: Cross fades two scenes using the RenderTexture object. More...
 
class  TransitionTurnOffTiles
 TransitionTurnOffTiles: Turn off the tiles of the outgoing scene in random order. More...
 
class  TransitionSplitCols
 TransitionSplitCols: The odd columns goes upwards while the even columns goes downwards. More...
 
class  TransitionSplitRows
 TransitionSplitRows: The odd rows goes to the left while the even rows goes to the right. More...
 
class  TransitionFadeTR
 TransitionFadeTR: Fade the tiles of the outgoing scene from the left-bottom corner the to top-right corner. More...
 
class  TransitionFadeBL
 TransitionFadeBL: Fade the tiles of the outgoing scene from the top-right corner to the bottom-left corner. More...
 
class  TransitionFadeUp
 TransitionFadeUp: Fade the tiles of the outgoing scene from the bottom to the top. More...
 
class  TransitionFadeDown
 TransitionFadeDown: Fade the tiles of the outgoing scene from the top to the bottom. More...
 
class  TransitionPageTurn
 A transition which peels back the bottom right hand corner of a scene to transition to the scene beneath it simulating a page turn. More...
 
class  TransitionProgress
 A base class of progress transition. More...
 
class  TransitionProgressRadialCCW
 TransitionRadialCCW transition. More...
 
class  TransitionProgressRadialCW
 TransitionRadialCW transition. More...
 
class  TransitionProgressHorizontal
 TransitionProgressHorizontal transition. More...
 
class  TransitionProgressVertical
 TransitionProgressVertical transition. More...
 
class  TransitionProgressInOut
 TransitionProgressInOut transition. More...
 
class  TransitionProgressOutIn
 TransitionProgressOutIn transition. More...
 
class  Texture2D
 Texture2D class. More...
 
struct  TexParams
 Extension to set the Min / Mag filter. More...
 
class  TextureAtlas
 A class that implements a Texture Atlas. More...
 
class  TextureCache
 Singleton that handles the loading of textures. More...
 

Enumerations

enum  Overflow { , SHRINK, CLAMP, RESIZE_HEIGHT }
 
enum  State
 Menu state, it's used internally.
 
enum  Type { RADIAL, BAR }
 Types of progress. More...
 
enum  { TMXOrientationOrtho, TMXOrientationHex, TMXOrientationIso, TMXOrientationStaggered }
 Possible orientations of the TMX map. More...
 
enum  Orientation { LEFT_OVER = 0, RIGHT_OVER = 1, UP_OVER = 0, DOWN_OVER = 1 }
 Orientation Type used by some transitions. More...
 
enum  PixelFormat {
  AUTO, BGRA8888, RGBA8888, RGB888,
  RGB565, A8, I8, AI88,
  RGBA4444, RGB5A1, PVRTC4, PVRTC4A,
  PVRTC2, PVRTC2A, ETC, S3TC_DXT1,
  S3TC_DXT3, S3TC_DXT5, ATC_RGB, ATC_EXPLICIT_ALPHA,
  ATC_INTERPOLATED_ALPHA, DEFAULT = AUTO
}
 Possible texture pixel formats. More...
 

Functions

PolygonInfo & operator= (const PolygonInfo &other)
 Copy the member of the other PolygonInfo another PolygonInfo to be copied.
 
var operator= ( var other)
 Copy the member of the other PolygonInfo another PolygonInfo to be copied.
 
local operator= ( local other)
 Copy the member of the other PolygonInfo another PolygonInfo to be copied.
 
void setQuad (V3F_C4B_T2F_Quad *quad)
 set the data to be a pointer to a quad the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects a pointer to the V3F_C4B_T2F_Quad object
 
void setTriangles (TrianglesCommand::Triangles triangles)
 set the data to be a pointer to a triangles the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects More...
 
local setTriangles ( local triangles)
 set the data to be a pointer to a triangles the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects More...
 
const unsigned int getVertCount () const
 get vertex count number of vertices
 
const unsigned int getTriaglesCount () const
 get triangles count number of triangles
 
const float getArea () const
 get sum of all triangle area size sum of all triangle area size
 
 AutoPolygon (const std::string &filename)
 create an AutoPolygon and initialize it with an image file the image must be a 32bit PNG for current version 3.7 a path to image file, e.g., "scene1/monster.png". More...
 
 ~AutoPolygon ()
 Destructor of AutoPolygon.
 
std::vector< Vec2 > trace (const cocos2d::Rect &rect, const float &threshold=0.0)
 trace all the points along the outline of the image, must create AutoPolygon with filename to use this function a texture rect for specify an area of the image, use Rect::Zero for the size of the image, default to Rect::Zero the value when alpha is greater than this value will be counted as opaque, default to 0.0 a vector of vec2 of all the points found in clockwise order
 
var trace ( var rect, var 0)
 trace all the points along the outline of the image, must create AutoPolygon with filename to use this function a texture rect for specify an area of the image, use Rect::Zero for the size of the image, default to Rect::Zero the value when alpha is greater than this value will be counted as opaque, default to 0.0 a vector of vec2 of all the points found in clockwise order
 
local trace ( local rect, local 0)
 trace all the points along the outline of the image, must create AutoPolygon with filename to use this function a texture rect for specify an area of the image, use Rect::Zero for the size of the image, default to Rect::Zero the value when alpha is greater than this value will be counted as opaque, default to 0.0 a vector of vec2 of all the points found in clockwise order
 
std::vector< Vec2 > reduce (const std::vector< Vec2 > &points, const Rect &rect, const float &epsilon=2.0)
 reduce the amount of points so its faster for GPU to process and draw based on Ramer-Douglas-Puecker algorithm a vector of Vec2 points as input a texture rect for specify an area of the image to avoid over reduction the perpendicular distance where points smaller than this value will be discarded a vector of Vec2 of the remaining points in clockwise order
 
var reduce ( var points, var rect, var 0)
 reduce the amount of points so its faster for GPU to process and draw based on Ramer-Douglas-Puecker algorithm a vector of Vec2 points as input a texture rect for specify an area of the image to avoid over reduction the perpendicular distance where points smaller than this value will be discarded a vector of Vec2 of the remaining points in clockwise order
 
local reduce ( local points, local rect, local 0)
 reduce the amount of points so its faster for GPU to process and draw based on Ramer-Douglas-Puecker algorithm a vector of Vec2 points as input a texture rect for specify an area of the image to avoid over reduction the perpendicular distance where points smaller than this value will be discarded a vector of Vec2 of the remaining points in clockwise order
 
std::vector< Vec2 > expand (const std::vector< Vec2 > &points, const Rect &rect, const float &epsilon)
 expand the points along their edge, useful after you reduce the points that cuts into the sprite using ClipperLib a vector of Vec2 points as input a texture rect for specify an area of the image, the expanded points will be clamped in this rect, ultimately resulting in a quad if the expansion is too great the distance which the edges will expand a vector of Vec2 as the result of the expansion
 
local expand ( local points, local rect, local epsilon)
 expand the points along their edge, useful after you reduce the points that cuts into the sprite using ClipperLib a vector of Vec2 points as input a texture rect for specify an area of the image, the expanded points will be clamped in this rect, ultimately resulting in a quad if the expansion is too great the distance which the edges will expand a vector of Vec2 as the result of the expansion
 
TrianglesCommand::Triangles triangulate (const std::vector< Vec2 > &points)
 Triangulate the input points into triangles for rendering using poly2tri points must be closed loop, cannot have 2 points sharing the same position and cannot intersect itself a vector of vec2 points as input a Triangles object with points and indices.
 
void calculateUV (const Rect &rect, V3F_C4B_T2F *verts, const ssize_t &count)
 calculate the UV coordinates for each points based on a texture rect This method requires the AutoPolygon object to know the texture file dimension a texture rect to specify where to map the UV a pointer to the verts array, served both as input and output verts the count for the verts array
 
PolygonInfo generateTriangles (const Rect &rect=Rect::ZERO, const float &epsilon=2.0, const float &threshold=0.05)
 a helper function, packing trace, reduce, expand, triangulate and calculate uv in one function texture rect, use Rect::ZERO for the size of the texture, default is Rect::ZERO the value used to reduce and expand, default to 2.0 the value where bigger than the threshold will be counted as opaque, used in trace a PolygonInfo, to use with sprite
 
local generateTriangles ( local ZERO, local 0, local 05)
 a helper function, packing trace, reduce, expand, triangulate and calculate uv in one function texture rect, use Rect::ZERO for the size of the texture, default is Rect::ZERO the value used to reduce and expand, default to 2.0 the value where bigger than the threshold will be counted as opaque, used in trace a PolygonInfo, to use with sprite
 
static PolygonInfo generatePolygon (const std::string &filename, const Rect &rect=Rect::ZERO, const float epsilon=2.0, const float threshold=0.05)
 a helper function, packing autoPolygon creation, trace, reduce, expand, triangulate and calculate uv in one function if you want to repetitively generate polygons, consider create an AutoPolygon object, and use generateTriangles function, as it only reads the file once A path to image file, e.g., "scene1/monster.png". More...
 
local generatePolygon ( local filename, local ZERO, local 0, local 05)
 a helper function, packing autoPolygon creation, trace, reduce, expand, triangulate and calculate uv in one function if you want to repetitively generate polygons, consider create an AutoPolygon object, and use generateTriangles function, as it only reads the file once A path to image file, e.g., "scene1/monster.png". More...
 
bool isScreenPointInRect (const Vec2 &pt, const Camera *camera, const Mat4 &w2l, const Rect &rect, Vec3 *p)
 This is a helper function, checks a GL screen point is in content rectangle space. More...
 

Creators

 PolygonInfo ()
 Creates an empty Polygon info PolygonInfo PolygonInfo object.
 
 PolygonInfo (const PolygonInfo &other)
 Create an Polygoninfo from the data of another Polygoninfo another PolygonInfo to be copied duplicate of the other PolygonInfo.
 
 PolygonInfo ( var other)
 Create an Polygoninfo from the data of another Polygoninfo another PolygonInfo to be copied duplicate of the other PolygonInfo.
 
 PolygonInfo ( local other)
 Create an Polygoninfo from the data of another Polygoninfo another PolygonInfo to be copied duplicate of the other PolygonInfo.
 

Detailed Description

Enumeration Type Documentation

enum Overflow
strong
Enumerator
SHRINK 

In SHRINK mode, the font size will change dynamically to adapt the content size.

CLAMP 

In CLAMP mode, when label content goes out of the bounding box, it will be clipped.

RESIZE_HEIGHT 

In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically.

var Overflow
strong
Enumerator
SHRINK 

In SHRINK mode, the font size will change dynamically to adapt the content size.

CLAMP 

In CLAMP mode, when label content goes out of the bounding box, it will be clipped.

RESIZE_HEIGHT 

In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically.

local Overflow
strong
Enumerator
SHRINK 

In SHRINK mode, the font size will change dynamically to adapt the content size.

CLAMP 

In CLAMP mode, when label content goes out of the bounding box, it will be clipped.

RESIZE_HEIGHT 

In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically.

enum Type
strong

Types of progress.

Enumerator
RADIAL 

Radial Counter-Clockwise.

BAR 

Bar.

var Type
strong

Types of progress.

Enumerator
RADIAL 

Radial Counter-Clockwise.

BAR 

Bar.

local Type
strong

Types of progress.

Enumerator
RADIAL 

Radial Counter-Clockwise.

BAR 

Bar.

anonymous enum

Possible orientations of the TMX map.

Enumerator
TMXOrientationOrtho 

Orthogonal orientation.

TMXOrientationHex 

Hexagonal orientation.

TMXOrientationIso 

Isometric orientation.

TMXOrientationStaggered 

Isometric staggered orientation.

var enum

Possible orientations of the TMX map.

Enumerator
TMXOrientationOrtho 

Orthogonal orientation.

TMXOrientationHex 

Hexagonal orientation.

TMXOrientationIso 

Isometric orientation.

TMXOrientationStaggered 

Isometric staggered orientation.

local enum

Possible orientations of the TMX map.

Enumerator
TMXOrientationOrtho 

Orthogonal orientation.

TMXOrientationHex 

Hexagonal orientation.

TMXOrientationIso 

Isometric orientation.

TMXOrientationStaggered 

Isometric staggered orientation.

enum Orientation
strong

Orientation Type used by some transitions.

Enumerator
LEFT_OVER 

An horizontal orientation where the Left is nearer.

RIGHT_OVER 

An horizontal orientation where the Right is nearer.

UP_OVER 

A vertical orientation where the Up is nearer.

DOWN_OVER 

A vertical orientation where the Bottom is nearer.

var Orientation
strong

Orientation Type used by some transitions.

Enumerator
LEFT_OVER 

An horizontal orientation where the Left is nearer.

RIGHT_OVER 

An horizontal orientation where the Right is nearer.

UP_OVER 

A vertical orientation where the Up is nearer.

DOWN_OVER 

A vertical orientation where the Bottom is nearer.

local Orientation
strong

Orientation Type used by some transitions.

Enumerator
LEFT_OVER 

An horizontal orientation where the Left is nearer.

RIGHT_OVER 

An horizontal orientation where the Right is nearer.

UP_OVER 

A vertical orientation where the Up is nearer.

DOWN_OVER 

A vertical orientation where the Bottom is nearer.

enum PixelFormat
strong

Possible texture pixel formats.

Enumerator
AUTO 

auto detect the type

BGRA8888 

32-bit texture: BGRA8888

RGBA8888 

32-bit texture: RGBA8888

RGB888 

24-bit texture: RGB888

RGB565 

16-bit texture without Alpha channel

A8 

8-bit textures used as masks

I8 

8-bit intensity texture

AI88 

16-bit textures used as masks

RGBA4444 

16-bit textures: RGBA4444

RGB5A1 

16-bit textures: RGB5A1

PVRTC4 

4-bit PVRTC-compressed texture: PVRTC4

PVRTC4A 

4-bit PVRTC-compressed texture: PVRTC4 (has alpha channel)

PVRTC2 

2-bit PVRTC-compressed texture: PVRTC2

PVRTC2A 

2-bit PVRTC-compressed texture: PVRTC2 (has alpha channel)

ETC 

ETC-compressed texture: ETC.

S3TC_DXT1 

S3TC-compressed texture: S3TC_Dxt1.

S3TC_DXT3 

S3TC-compressed texture: S3TC_Dxt3.

S3TC_DXT5 

S3TC-compressed texture: S3TC_Dxt5.

ATC_RGB 

ATITC-compressed texture: ATC_RGB.

ATC_EXPLICIT_ALPHA 

ATITC-compressed texture: ATC_EXPLICIT_ALPHA.

ATC_INTERPOLATED_ALPHA 

ATITC-compresed texture: ATC_INTERPOLATED_ALPHA.

DEFAULT 

Default texture format: AUTO.

var PixelFormat
strong

Possible texture pixel formats.

Enumerator
AUTO 

auto detect the type

BGRA8888 

32-bit texture: BGRA8888

RGBA8888 

32-bit texture: RGBA8888

RGB888 

24-bit texture: RGB888

RGB565 

16-bit texture without Alpha channel

A8 

8-bit textures used as masks

I8 

8-bit intensity texture

AI88 

16-bit textures used as masks

RGBA4444 

16-bit textures: RGBA4444

RGB5A1 

16-bit textures: RGB5A1

PVRTC4 

4-bit PVRTC-compressed texture: PVRTC4

PVRTC4A 

4-bit PVRTC-compressed texture: PVRTC4 (has alpha channel)

PVRTC2 

2-bit PVRTC-compressed texture: PVRTC2

PVRTC2A 

2-bit PVRTC-compressed texture: PVRTC2 (has alpha channel)

ETC 

ETC-compressed texture: ETC.

S3TC_DXT1 

S3TC-compressed texture: S3TC_Dxt1.

S3TC_DXT3 

S3TC-compressed texture: S3TC_Dxt3.

S3TC_DXT5 

S3TC-compressed texture: S3TC_Dxt5.

ATC_RGB 

ATITC-compressed texture: ATC_RGB.

ATC_EXPLICIT_ALPHA 

ATITC-compressed texture: ATC_EXPLICIT_ALPHA.

ATC_INTERPOLATED_ALPHA 

ATITC-compresed texture: ATC_INTERPOLATED_ALPHA.

DEFAULT 

Default texture format: AUTO.

local PixelFormat
strong

Possible texture pixel formats.

Enumerator
AUTO 

auto detect the type

BGRA8888 

32-bit texture: BGRA8888

RGBA8888 

32-bit texture: RGBA8888

RGB888 

24-bit texture: RGB888

RGB565 

16-bit texture without Alpha channel

A8 

8-bit textures used as masks

I8 

8-bit intensity texture

AI88 

16-bit textures used as masks

RGBA4444 

16-bit textures: RGBA4444

RGB5A1 

16-bit textures: RGB5A1

PVRTC4 

4-bit PVRTC-compressed texture: PVRTC4

PVRTC4A 

4-bit PVRTC-compressed texture: PVRTC4 (has alpha channel)

PVRTC2 

2-bit PVRTC-compressed texture: PVRTC2

PVRTC2A 

2-bit PVRTC-compressed texture: PVRTC2 (has alpha channel)

ETC 

ETC-compressed texture: ETC.

S3TC_DXT1 

S3TC-compressed texture: S3TC_Dxt1.

S3TC_DXT3 

S3TC-compressed texture: S3TC_Dxt3.

S3TC_DXT5 

S3TC-compressed texture: S3TC_Dxt5.

ATC_RGB 

ATITC-compressed texture: ATC_RGB.

ATC_EXPLICIT_ALPHA 

ATITC-compressed texture: ATC_EXPLICIT_ALPHA.

ATC_INTERPOLATED_ALPHA 

ATITC-compresed texture: ATC_INTERPOLATED_ALPHA.

DEFAULT 

Default texture format: AUTO.

Function Documentation

void setTriangles ( TrianglesCommand::Triangles  triangles)

set the data to be a pointer to a triangles the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects

Parameters
trianglesa pointer to the TrianglesCommand::Triangles object
var setTriangles ( var  triangles)

set the data to be a pointer to a triangles the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects

Parameters
trianglesa pointer to the TrianglesCommand::Triangles object
local setTriangles ( local  triangles)

set the data to be a pointer to a triangles the member verts will not be released when this PolygonInfo destructs as the verts memory are managed by other objects

Parameters
trianglesa pointer to the TrianglesCommand::Triangles object
AutoPolygon ( const std::string &  filename)

create an AutoPolygon and initialize it with an image file the image must be a 32bit PNG for current version 3.7 a path to image file, e.g., "scene1/monster.png".

an AutoPolygon object;

var AutoPolygon ( var  filename)

create an AutoPolygon and initialize it with an image file the image must be a 32bit PNG for current version 3.7 a path to image file, e.g., "scene1/monster.png".

an AutoPolygon object;

local AutoPolygon ( local  filename)

create an AutoPolygon and initialize it with an image file the image must be a 32bit PNG for current version 3.7 a path to image file, e.g., "scene1/monster.png".

an AutoPolygon object;

static PolygonInfo generatePolygon ( const std::string &  filename,
const Rect rect = Rect::ZERO,
const float  epsilon = 2.0,
const float  threshold = 0.05 
)
static

a helper function, packing autoPolygon creation, trace, reduce, expand, triangulate and calculate uv in one function if you want to repetitively generate polygons, consider create an AutoPolygon object, and use generateTriangles function, as it only reads the file once A path to image file, e.g., "scene1/monster.png".

texture rect, use Rect::ZERO for the size of the texture, default is Rect::ZERO the value used to reduce and expand, default to 2.0 the value where bigger than the threshold will be counted as opaque, used in trace a PolygonInfo, to use with sprite

var generatePolygon ( var  filename,
var  rect = Rect::ZERO,
var  epsilon = 2.0,
var  threshold = 0.05 
)
static

a helper function, packing autoPolygon creation, trace, reduce, expand, triangulate and calculate uv in one function if you want to repetitively generate polygons, consider create an AutoPolygon object, and use generateTriangles function, as it only reads the file once A path to image file, e.g., "scene1/monster.png".

texture rect, use Rect::ZERO for the size of the texture, default is Rect::ZERO the value used to reduce and expand, default to 2.0 the value where bigger than the threshold will be counted as opaque, used in trace a PolygonInfo, to use with sprite

local generatePolygon ( local  filename,
local  rect = Rect::ZERO,
local  epsilon = 2.0,
local  threshold = 0.05 
)
static

a helper function, packing autoPolygon creation, trace, reduce, expand, triangulate and calculate uv in one function if you want to repetitively generate polygons, consider create an AutoPolygon object, and use generateTriangles function, as it only reads the file once A path to image file, e.g., "scene1/monster.png".

texture rect, use Rect::ZERO for the size of the texture, default is Rect::ZERO the value used to reduce and expand, default to 2.0 the value where bigger than the threshold will be counted as opaque, used in trace a PolygonInfo, to use with sprite

bool cocos2d::isScreenPointInRect ( const Vec2 &  pt,
const Camera *  camera,
const Mat4 &  w2l,
const Rect &  rect,
Vec3 *  p 
)

This is a helper function, checks a GL screen point is in content rectangle space.

The content rectangle defined by origin(0,0) and content size. This function convert GL screen point to near and far planes as points Pn and Pf, then calculate the intersect point P which the line PnPf intersect with content rectangle. If P in content rectangle means this node be hit.

Parameters
ptThe point in GL screen space.
cameraWhich camera used to unproject pt to near/far planes.
w2lWorld to local transform matrix, used to convert Pn and Pf to rectangle space.
rectThe test rectangle in local space. p Point to a Vec3 for store the intersect point, if don't need them set to nullptr.
Returns
true if the point is in content rectangle, false otherwise.
var isScreenPointInRect ( var  pt,
var  camera,
var  w2l,
var  rect,
var  p 
)

This is a helper function, checks a GL screen point is in content rectangle space.

The content rectangle defined by origin(0,0) and content size. This function convert GL screen point to near and far planes as points Pn and Pf, then calculate the intersect point P which the line PnPf intersect with content rectangle. If P in content rectangle means this node be hit.

Parameters
ptThe point in GL screen space.
cameraWhich camera used to unproject pt to near/far planes.
w2lWorld to local transform matrix, used to convert Pn and Pf to rectangle space.
rectThe test rectangle in local space. p Point to a Vec3 for store the intersect point, if don't need them set to nullptr.
Returns
true if the point is in content rectangle, false otherwise.
local isScreenPointInRect ( local  pt,
local  camera,
local  w2l,
local  rect,
local  p 
)

This is a helper function, checks a GL screen point is in content rectangle space.

The content rectangle defined by origin(0,0) and content size. This function convert GL screen point to near and far planes as points Pn and Pf, then calculate the intersect point P which the line PnPf intersect with content rectangle. If P in content rectangle means this node be hit.

Parameters
ptThe point in GL screen space.
cameraWhich camera used to unproject pt to near/far planes.
w2lWorld to local transform matrix, used to convert Pn and Pf to rectangle space.
rectThe test rectangle in local space. p Point to a Vec3 for store the intersect point, if don't need them set to nullptr.
Returns
true if the point is in content rectangle, false otherwise.