cocos2d-x  3.0-rc0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
cocos2d::DrawPrimitives Namespace Reference

Functions

void  ()
 Initializes the drawing primitives. More...
 
void  ()
 Frees allocated resources by the drawing primitives. More...
 
void  (const Point &point)
 draws a point given x and y coordinate measured in points More...
 
local  ( local point)
 draws a point given x and y coordinate measured in points More...
 
void  (const Point *points, unsigned int numberOfPoints)
 draws an array of points. More...
 
void  (const Point &origin, const Point &destination)
 draws a line given the origin and destination point measured in points More...
 
void  (Point origin, Point destination)
 draws a rectangle given the origin and destination point measured in points. More...
 
void  (Point origin, Point destination, Color4F color)
 draws a solid rectangle given the origin and destination point measured in points. More...
 
void  (const Point *vertices, unsigned int numOfVertices, bool closePolygon)
 draws a polygon given a pointer to Point coordinates and the number of vertices measured in points. More...
 
local  ( local vertices, local numOfVertices, local closePolygon)
 draws a polygon given a pointer to Point coordinates and the number of vertices measured in points. More...
 
void  (const Point *poli, unsigned int numberOfPoints, Color4F color)
 draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color. More...
 
void  (const Point &center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY)
 draws a circle given the center, radius and number of segments. More...
 
var  ( var center, var radius, var angle, var segments, var drawLineToCenter, var scaleX, var scaleY)
 draws a circle given the center, radius and number of segments. More...
 
local  ( local center, local radius, local angle, local segments, local drawLineToCenter, local scaleX, local scaleY)
 draws a circle given the center, radius and number of segments. More...
 
void  (const Point &center, float radius, float angle, unsigned int segments, bool drawLineToCenter)
local  ( local center, local radius, local angle, local segments, local drawLineToCenter)
void  (const Point &center, float radius, float angle, unsigned int segments, float scaleX, float scaleY)
 draws a solid circle given the center, radius and number of segments. More...
 
void  (const Point &center, float radius, float angle, unsigned int segments)
local  ( local center, local radius, local angle, local segments)
void  (const Point &origin, const Point &control, const Point &destination, unsigned int segments)
 draws a quad bezier path More...
 
var  ( var origin, var control, var destination, var segments)
 draws a quad bezier path More...
 
local  ( local origin, local control, local destination, local segments)
 draws a quad bezier path More...
 
void  (const Point &origin, const Point &control1, const Point &control2, const Point &destination, unsigned int segments)
 draws a cubic bezier path More...
 
local  ( local origin, local control1, local control2, local destination, local segments)
 draws a cubic bezier path More...
 
void  (PointArray *arrayOfControlPoints, unsigned int segments)
 draws a Catmull Rom path. More...
 
void  (PointArray *config, float tension, unsigned int segments)
 draws a Cardinal Spline path. More...
 
var  ( var config, var tension, var segments)
 draws a Cardinal Spline path. More...
 
local  ( local config, local tension, local segments)
 draws a Cardinal Spline path. More...
 
void  (GLubyte r, GLubyte g, GLubyte b, GLubyte a)
 set the drawing color with 4 unsigned bytes More...
 
local  ( local r, local g, local b, local a)
 set the drawing color with 4 unsigned bytes More...
 
void  (GLfloat r, GLfloat g, GLfloat b, GLfloat a)
 set the drawing color with 4 floats More...
 
void  (GLfloat pointSize)
 set the point size in points. More...
 

Function Documentation

void cocos2d::DrawPrimitives::init ( )

Initializes the drawing primitives.

var init ( )

Initializes the drawing primitives.

local init ( )

Initializes the drawing primitives.

void cocos2d::DrawPrimitives::free ( )

Frees allocated resources by the drawing primitives.

var free ( )

Frees allocated resources by the drawing primitives.

local free ( )

Frees allocated resources by the drawing primitives.

void
cocos2d::DrawPrimitives::drawPoint
( const Point &  point)

draws a point given x and y coordinate measured in points

var drawPoint ( var  point)

draws a point given x and y coordinate measured in points

local drawPoint ( local  point)

draws a point given x and y coordinate measured in points

void
cocos2d::DrawPrimitives::drawPoints
( const Point *  points,
unsigned int  numberOfPoints 
)

draws an array of points.

Since
v0.7.2
var drawPoints ( var  points,
var  numberOfPoints 
)

draws an array of points.

Since
v0.7.2
local drawPoints ( local  points,
local  numberOfPoints 
)

draws an array of points.

Since
v0.7.2
void
cocos2d::DrawPrimitives::drawLine
( const Point &  origin,
const Point &  destination 
)

draws a line given the origin and destination point measured in points

var drawLine ( var  origin,
var  destination 
)

draws a line given the origin and destination point measured in points

local drawLine ( local  origin,
local  destination 
)

draws a line given the origin and destination point measured in points

void
cocos2d::DrawPrimitives::drawRect
( Point  origin,
Point  destination 
)

draws a rectangle given the origin and destination point measured in points.

var drawRect ( var  origin,
var  destination 
)

draws a rectangle given the origin and destination point measured in points.

local drawRect ( local  origin,
local  destination 
)

draws a rectangle given the origin and destination point measured in points.

void
cocos2d::DrawPrimitives::drawSolidRect
( Point  origin,
Point  destination,
Color4F  color 
)

draws a solid rectangle given the origin and destination point measured in points.

Since
1.1
var drawSolidRect ( var  origin,
var  destination,
var  color 
)

draws a solid rectangle given the origin and destination point measured in points.

Since
1.1
local drawSolidRect ( local  origin,
local  destination,
local  color 
)

draws a solid rectangle given the origin and destination point measured in points.

Since
1.1
void
cocos2d::DrawPrimitives::drawPoly
( const Point *  vertices,
unsigned int  numOfVertices,
bool  closePolygon 
)

draws a polygon given a pointer to Point coordinates and the number of vertices measured in points.

The polygon can be closed or open

var drawPoly ( var  vertices,
var  numOfVertices,
var  closePolygon 
)

draws a polygon given a pointer to Point coordinates and the number of vertices measured in points.

The polygon can be closed or open

local drawPoly ( local  vertices,
local  numOfVertices,
local  closePolygon 
)

draws a polygon given a pointer to Point coordinates and the number of vertices measured in points.

The polygon can be closed or open

void
cocos2d::DrawPrimitives::drawSolidPoly
( const Point *  poli,
unsigned int  numberOfPoints,
Color4F  color 
)

draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.

var drawSolidPoly ( var  poli,
var  numberOfPoints,
var  color 
)

draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.

local drawSolidPoly ( local  poli,
local  numberOfPoints,
local  color 
)

draws a solid polygon given a pointer to CGPoint coordinates, the number of vertices measured in points, and a color.

void
cocos2d::DrawPrimitives::drawCircle
( const Point &  center,
float  radius,
float  angle,
unsigned int  segments,
bool  drawLineToCenter,
float  scaleX,
float  scaleY 
)

draws a circle given the center, radius and number of segments.

var drawCircle ( var  center,
var  radius,
var  angle,
var  segments,
var  drawLineToCenter,
var  scaleX,
var  scaleY 
)

draws a circle given the center, radius and number of segments.

local drawCircle ( local  center,
local  radius,
local  angle,
local  segments,
local  drawLineToCenter,
local  scaleX,
local  scaleY 
)

draws a circle given the center, radius and number of segments.

void
cocos2d::DrawPrimitives::drawCircle
( const Point &  center,
float  radius,
float  angle,
unsigned int  segments,
bool  drawLineToCenter 
)
var drawCircle ( var  center,
var  radius,
var  angle,
var  segments,
var  drawLineToCenter 
)
local drawCircle ( local  center,
local  radius,
local  angle,
local  segments,
local  drawLineToCenter 
)
void
cocos2d::DrawPrimitives::drawSolidCircle
( const Point &  center,
float  radius,
float  angle,
unsigned int  segments,
float  scaleX,
float  scaleY 
)

draws a solid circle given the center, radius and number of segments.

var drawSolidCircle ( var  center,
var  radius,
var  angle,
var  segments,
var  scaleX,
var  scaleY 
)

draws a solid circle given the center, radius and number of segments.

local drawSolidCircle ( local  center,
local  radius,
local  angle,
local  segments,
local  scaleX,
local  scaleY 
)

draws a solid circle given the center, radius and number of segments.

void
cocos2d::DrawPrimitives::drawSolidCircle
( const Point &  center,
float  radius,
float  angle,
unsigned int  segments 
)
var drawSolidCircle ( var  center,
var  radius,
var  angle,
var  segments 
)
local drawSolidCircle ( local  center,
local  radius,
local  angle,
local  segments 
)
void
cocos2d::DrawPrimitives::drawQuadBezier
( const Point &  origin,
const Point &  control,
const Point &  destination,
unsigned int  segments 
)

draws a quad bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
var drawQuadBezier ( var  origin,
var  control,
var  destination,
var  segments 
)

draws a quad bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
local drawQuadBezier ( local  origin,
local  control,
local  destination,
local  segments 
)

draws a quad bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
void
cocos2d::DrawPrimitives::drawCubicBezier
( const Point &  origin,
const Point &  control1,
const Point &  control2,
const Point &  destination,
unsigned int  segments 
)

draws a cubic bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
var drawCubicBezier ( var  origin,
var  control1,
var  control2,
var  destination,
var  segments 
)

draws a cubic bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
local drawCubicBezier ( local  origin,
local  control1,
local  control2,
local  destination,
local  segments 
)

draws a cubic bezier path

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v0.8
void
cocos2d::DrawPrimitives::drawCatmullRom
( PointArray *  arrayOfControlPoints,
unsigned int  segments 
)

draws a Catmull Rom path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
var drawCatmullRom ( var  arrayOfControlPoints,
var  segments 
)

draws a Catmull Rom path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
local drawCatmullRom ( local  arrayOfControlPoints,
local  segments 
)

draws a Catmull Rom path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
void
cocos2d::DrawPrimitives::drawCardinalSpline
( PointArray *  config,
float  tension,
unsigned int  segments 
)

draws a Cardinal Spline path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
var drawCardinalSpline ( var  config,
var  tension,
var  segments 
)

draws a Cardinal Spline path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
local drawCardinalSpline ( local  config,
local  tension,
local  segments 
)

draws a Cardinal Spline path.

Warning
This function could be pretty slow. Use it only for debugging purposes.
Since
v2.0
void
cocos2d::DrawPrimitives::setDrawColor4B
( GLubyte  r,
GLubyte  g,
GLubyte  b,
GLubyte  a 
)

set the drawing color with 4 unsigned bytes

Since
v2.0
var setDrawColor4B ( var  r,
var  g,
var  b,
var  a 
)

set the drawing color with 4 unsigned bytes

Since
v2.0
local setDrawColor4B ( local  r,
local  g,
local  b,
local  a 
)

set the drawing color with 4 unsigned bytes

Since
v2.0
void
cocos2d::DrawPrimitives::setDrawColor4F
( GLfloat  r,
GLfloat  g,
GLfloat  b,
GLfloat  a 
)

set the drawing color with 4 floats

Since
v2.0
var setDrawColor4F ( var  r,
var  g,
var  b,
var  a 
)

set the drawing color with 4 floats

Since
v2.0
local setDrawColor4F ( local  r,
local  g,
local  b,
local  a 
)

set the drawing color with 4 floats

Since
v2.0
void
cocos2d::DrawPrimitives::setPointSize
( GLfloat  pointSize)

set the point size in points.

Default 1.

Since
v2.0
var setPointSize ( var  pointSize)

set the point size in points.

Default 1.

Since
v2.0
local setPointSize ( local  pointSize)

set the point size in points.

Default 1.

Since
v2.0