Skip to main content

CCDrawNode

CCDrawNode

Cocos2D

Inheritance: System.Object → Cocos2D.CCNode

Implements: Cocos2D.ICCSelectorProtocol, Cocos2D.ICCFocusable, Cocos2D.ICCTargetedTouchDelegate, Cocos2D.ICCStandardTouchDelegate, Cocos2D.ICCTouchDelegate, Cocos2D.ICCKeypadDelegate, Cocos2D.ICCKeyboardDelegate, Cocos2D.ICCRGBAProtocol, System.Collections.Generic.IComparer{Cocos2D.CCNode}

Constructors

CCDrawNode()

CCDrawNode()()

Properties

BlendFunc(Cocos2D.CCBlendFunc)
FilterPrimitivesByAlpha(System.Boolean)

Methods

Clear()

Clear()()
Example

Draw()

Draw()()

This is called from the Visit() method. This is where you DRAW your node. Only draw stuff from this method call.

Example

DrawCircle(CCPoint, float, CCColor4B)

DrawCircle(CCPoint, float, CCColor4B)(Cocos2D.CCPoint center, System.Single radius, Cocos2D.CCColor4B color)
Parameters:
center (Cocos2D.CCPoint)
radius (System.Single)
color (Cocos2D.CCColor4B)

DrawCircle(CCPoint, float, float, int, CCColor4B)

DrawCircle(CCPoint, float, float, int, CCColor4B)(Cocos2D.CCPoint center, System.Single radius, System.Single angle, System.Int32 segments, Cocos2D.CCColor4B color)
Parameters:
center (Cocos2D.CCPoint)
radius (System.Single)
angle (System.Single)
segments (System.Int32)
color (Cocos2D.CCColor4B)

DrawCircleOutline(CCPoint, float, float, CCColor4B)

DrawCircleOutline(CCPoint, float, float, CCColor4B)(Cocos2D.CCPoint center, System.Single radius, System.Single lineWidth, Cocos2D.CCColor4B color)
Parameters:
center (Cocos2D.CCPoint)
radius (System.Single)
lineWidth (System.Single)
color (Cocos2D.CCColor4B)

DrawCircleOutline(CCPoint, float, float, float, int, CCColor4B)

DrawCircleOutline(CCPoint, float, float, float, int, CCColor4B)(Cocos2D.CCPoint center, System.Single radius, System.Single lineWidth, System.Single angle, System.Int32 segments, Cocos2D.CCColor4B color)
Parameters:
center (Cocos2D.CCPoint)
radius (System.Single)
lineWidth (System.Single)
angle (System.Single)
segments (System.Int32)
color (Cocos2D.CCColor4B)

DrawDot(CCPoint, float, CCColor4F)

DrawDot(CCPoint, float, CCColor4F)(Cocos2D.CCPoint pos, System.Single radius, Cocos2D.CCColor4F color)
Parameters:
pos (Cocos2D.CCPoint)
radius (System.Single)
color (Cocos2D.CCColor4F)
Example

DrawLine(CCPoint, CCPoint, CCColor4B, CCLineCap)

DrawLine(CCPoint, CCPoint, CCColor4B, CCLineCap)(Cocos2D.CCPoint from, Cocos2D.CCPoint to, Cocos2D.CCColor4B color, Cocos2D.CCLineCap lineCap)
Parameters:
from (Cocos2D.CCPoint)
to (Cocos2D.CCPoint)
color (Cocos2D.CCColor4B)
lineCap (Cocos2D.CCLineCap)

DrawLine(CCPoint, CCPoint, float, CCColor4B, CCLineCap)

DrawLine(CCPoint, CCPoint, float, CCColor4B, CCLineCap)(Cocos2D.CCPoint from, Cocos2D.CCPoint to, System.Single lineWidth, Cocos2D.CCColor4B color, Cocos2D.CCLineCap lineCap)
Parameters:
from (Cocos2D.CCPoint)
to (Cocos2D.CCPoint)
lineWidth (System.Single)
color (Cocos2D.CCColor4B)
lineCap (Cocos2D.CCLineCap)

DrawLine(CCPoint, CCPoint, float, CCLineCap)

DrawLine(CCPoint, CCPoint, float, CCLineCap)(Cocos2D.CCPoint from, Cocos2D.CCPoint to, System.Single lineWidth, Cocos2D.CCLineCap lineCap)
Parameters:
from (Cocos2D.CCPoint)
to (Cocos2D.CCPoint)
lineWidth (System.Single)
lineCap (Cocos2D.CCLineCap)

DrawPolygon(CCPoint[], int, CCColor4F, float, CCColor4F)

DrawPolygon(CCPoint[], int, CCColor4F, float, CCColor4F)(Cocos2D.CCPoint[] verts, System.Int32 count, Cocos2D.CCColor4F fillColor, System.Single borderWidth, Cocos2D.CCColor4F borderColor)
Parameters:
verts (Cocos2D.CCPoint[])
count (System.Int32)
fillColor (Cocos2D.CCColor4F)
borderWidth (System.Single)
borderColor (Cocos2D.CCColor4F)

DrawRect(CCRect, CCColor4B)

DrawRect(CCRect, CCColor4B)(Cocos2D.CCRect rect, Cocos2D.CCColor4B color)
Parameters:
rect (Cocos2D.CCRect)
color (Cocos2D.CCColor4B)

DrawRect(CCRect, CCColor4F, float, CCColor4F)

DrawRect(CCRect, CCColor4F, float, CCColor4F)(Cocos2D.CCRect rect, Cocos2D.CCColor4F color, System.Single borderWidth, Cocos2D.CCColor4F borderColor)
Parameters:
rect (Cocos2D.CCRect)
color (Cocos2D.CCColor4F)
borderWidth (System.Single)
borderColor (Cocos2D.CCColor4F)

DrawSegment(CCPoint, CCPoint, float, CCColor4F)

System.Int32 DrawSegment(CCPoint, CCPoint, float, CCColor4F)(Cocos2D.CCPoint from, Cocos2D.CCPoint to, System.Single radius, Cocos2D.CCColor4F color)

Creates 18 vertices that create a segment between the two points with the given radius of rounding on the segment end. The color is used to draw the segment.

Parameters:
from (Cocos2D.CCPoint)
to (Cocos2D.CCPoint)
radius (System.Single)
color (Cocos2D.CCColor4F)
Returns:
System.Int32 - The starting vertex index of the segment.
Example

DrawSolidArc(CCPoint, float, float, float, CCColor4B)

DrawSolidArc(CCPoint, float, float, float, CCColor4B)(Cocos2D.CCPoint pos, System.Single radius, System.Single startAngle, System.Single sweepAngle, Cocos2D.CCColor4B color)
Parameters:
pos (Cocos2D.CCPoint)
radius (System.Single)
startAngle (System.Single)
sweepAngle (System.Single)
color (Cocos2D.CCColor4B)

FadeBySegment(int, float)

FadeBySegment(int, float)(System.Int32 vertexStart, System.Single fadeFactor)
Parameters:
vertexStart (System.Int32)
fadeFactor (System.Single)

FadeByVertices(int, int, float)

FadeByVertices(int, int, float)(System.Int32 start, System.Int32 count, System.Single fadeFactor)

Multiplicatively applies the fadeFactor to the alpha channel of the vertices starting with start and for the number of vertices defined by count. the alpha channel is determined by the current alpha * fadeFactor.

Parameters:
start (System.Int32)
count (System.Int32)
fadeFactor (System.Single)
Example

FadeToSegment(int, float)

FadeToSegment(int, float)(System.Int32 vertexStart, System.Single fadeFactor)
Parameters:
vertexStart (System.Int32)
fadeFactor (System.Single)

FadeToVertices(int, int, float)

FadeToVertices(int, int, float)(System.Int32 start, System.Int32 count, System.Single fadeFactor)

For the start and count vertices drawn, this will set the alpha channel to the given fade factor. The alpha is determined by 255 * fadeFactor.

Parameters:
start (System.Int32)
count (System.Int32)
fadeFactor (System.Single)
Example

Init()

System.Boolean Init()()
Returns:
System.Boolean
Example

RemoveSegment(int)

RemoveSegment(int)(System.Int32 vertexStart)
Parameters:
vertexStart (System.Int32)