Cocos2d-x  v4
PointArray Class Reference

An Array that contain control points. More...

Inherits Ref, and Clonable.

Public Member Functions

virtual ~PointArray ()
 @js NA @lua NA
 
 PointArray ()
 @js NA @lua NA
 
bool initWithCapacity (ssize_t capacity)
 Initializes a Catmull Rom config with a capacity hint. More...
 
void addControlPoint (const Vec2 &controlPoint)
 Appends a control point. More...
 
void insertControlPoint (const Vec2 &controlPoint, ssize_t index)
 Inserts a controlPoint at index. More...
 
void replaceControlPoint (const Vec2 &controlPoint, ssize_t index)
 Replaces an existing controlPoint at index. More...
 
const Vec2getControlPointAtIndex (ssize_t index) const
 Get the value of a controlPoint at a given index. More...
 
void removeControlPointAtIndex (ssize_t index)
 Deletes a control point at a given index. More...
 
ssize_t count () const
 Returns the number of objects of the control point array. More...
 
PointArrayreverse () const
 Returns a new copy of the array reversed. More...
 
void reverseInline ()
 Reverse the current control point array inline, without generating a new one. More...
 
virtual PointArrayclone () const
 @js NA @lua NA
 
const std::vector< Vec2 > & getControlPoints () const
 @js NA
 
void setControlPoints (std::vector< Vec2 > controlPoints)
 @js NA
 
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()
 @js NA @lua NA
 

Static Public Member Functions

static PointArraycreate (ssize_t capacity)
 Creates and initializes a Points array with capacity. More...
 

Additional Inherited Members

- Public Attributes inherited from Ref
unsigned int _ID
 object id, ScriptSupport need public _ID
 
int _luaID
 Lua reference id.
 
void * _scriptObject
 scriptObject, support for swift
 
bool _rooted
 When true, it means that the object was already rooted.
 

Detailed Description

An Array that contain control points.

Used by CardinalSplineTo and (By) and CatmullRomTo (and By) actions.

@js NA

Member Function Documentation

◆ create()

static PointArray* create ( ssize_t  capacity)
static

Creates and initializes a Points array with capacity.

@js NA

Parameters
capacityThe size of the array.

◆ initWithCapacity()

bool initWithCapacity ( ssize_t  capacity)

Initializes a Catmull Rom config with a capacity hint.

@js NA

Parameters
capacityThe size of the array.
Returns
True.

◆ addControlPoint()

void addControlPoint ( const Vec2 controlPoint)

Appends a control point.

@js NA

Parameters
controlPointA control point.

◆ insertControlPoint()

void insertControlPoint ( const Vec2 controlPoint,
ssize_t  index 
)

Inserts a controlPoint at index.

@js NA

Parameters
controlPointA control point.
indexInsert the point to array in index.

◆ replaceControlPoint()

void replaceControlPoint ( const Vec2 controlPoint,
ssize_t  index 
)

Replaces an existing controlPoint at index.

@js NA

Parameters
controlPointA control point.
indexReplace the point to array in index.

◆ getControlPointAtIndex()

const Vec2& getControlPointAtIndex ( ssize_t  index) const

Get the value of a controlPoint at a given index.

@js NA

Parameters
indexGet the point in index.
Returns
A Vec2.

◆ removeControlPointAtIndex()

void removeControlPointAtIndex ( ssize_t  index)

Deletes a control point at a given index.

@js NA

Parameters
indexRemove the point in index.

◆ count()

ssize_t count ( ) const

Returns the number of objects of the control point array.

@js NA

Returns
The number of objects of the control point array.

◆ reverse()

PointArray* reverse ( ) const

Returns a new copy of the array reversed.

User is responsible for releasing this copy.

@js NA

Returns
A new copy of the array reversed.

◆ reverseInline()

void reverseInline ( )

Reverse the current control point array inline, without generating a new one.

@js NA


The documentation for this class was generated from the following file: