CCDrawManager
CCDrawManager
Cocos2DInheritance: System.Object
Fields
AlphaTestEffect(Microsoft.Xna.Framework.Graphics.AlphaTestEffect)
DefaultFont(System.String)
DrawCount(System.Int32)
PrimitiveEffect(Microsoft.Xna.Framework.Graphics.BasicEffect)
spriteBatch(Microsoft.Xna.Framework.Graphics.SpriteBatch)
Properties
BlendState(Microsoft.Xna.Framework.Graphics.BlendState)
DepthStencilState(Microsoft.Xna.Framework.Graphics.DepthStencilState)
DepthTest(System.Boolean)
DesignResolutionSize(Cocos2D.CCSize)
FrameSize(Cocos2D.CCSize)
GraphicsDevice(Microsoft.Xna.Framework.Graphics.GraphicsDevice)
ProjectionMatrix(Microsoft.Xna.Framework.Matrix)
ResolutionPolicy(Cocos2D.CCResolutionPolicy)
ScaleX(System.Single)
ScaleY(System.Single)
ScissorRect(Cocos2D.CCRect)
ScissorRectEnabled(System.Boolean)
TextureEnabled(System.Boolean)
VertexColorEnabled(System.Boolean)
ViewMatrix(Microsoft.Xna.Framework.Matrix)
ViewPortRect(Cocos2D.CCRect)
VisibleOrigin(Cocos2D.CCPoint)
VisibleSize(Cocos2D.CCSize)
WorldMatrix(Microsoft.Xna.Framework.Matrix)
Methods
BeginDraw()
System.Boolean BeginDraw()()
Returns:
System.Boolean
BeginDrawMask()
System.Boolean BeginDrawMask()()
Returns:
System.Boolean
BeginDrawMask(bool)
System.Boolean BeginDrawMask(bool)(System.Boolean inverted)
Parameters:
inverted
(System.Boolean)Returns:
System.Boolean
BeginDrawMask(bool, float)
System.Boolean BeginDrawMask(bool, float)(System.Boolean inverted, System.Single alphaTreshold)
Parameters:
inverted
(System.Boolean)alphaTreshold
(System.Single)Returns:
System.Boolean
BeginDrawMask(float)
System.Boolean BeginDrawMask(float)(System.Single alphaTreshold)
Parameters:
alphaTreshold
(System.Single)Returns:
System.Boolean
BindTexture(CCTexture2D)
BindTexture(CCTexture2D)(Cocos2D.CCTexture2D texture)
Parameters:
texture
(Cocos2D.CCTexture2D)BlendFunc(CCBlendFunc)
BlendFunc(CCBlendFunc)(Cocos2D.CCBlendFunc blendFunc)
Parameters:
blendFunc
(Cocos2D.CCBlendFunc)Clear(Color)
Clear(Color)(Microsoft.Xna.Framework.Color color)
Parameters:
color
(Microsoft.Xna.Framework.Color)Clear(Color, float)
Clear(Color, float)(Microsoft.Xna.Framework.Color color, System.Single depth)
Parameters:
color
(Microsoft.Xna.Framework.Color)depth
(System.Single)Clear(Color, float, int)
Clear(Color, float, int)(Microsoft.Xna.Framework.Color color, System.Single depth, System.Int32 stencil)
Parameters:
color
(Microsoft.Xna.Framework.Color)depth
(System.Single)stencil
(System.Int32)Clear(ClearOptions, Color, float, int)
Clear(ClearOptions, Color, float, int)(Microsoft.Xna.Framework.Graphics.ClearOptions options, Microsoft.Xna.Framework.Color color, System.Single depth, System.Int32 stencil)
Parameters:
options
(Microsoft.Xna.Framework.Graphics.ClearOptions)color
(Microsoft.Xna.Framework.Color)depth
(System.Single)stencil
(System.Int32)CreateRenderTarget(CCTexture2D, RenderTargetUsage)
CreateRenderTarget(CCTexture2D, RenderTargetUsage)(Cocos2D.CCTexture2D pTexture, Microsoft.Xna.Framework.Graphics.RenderTargetUsage usage)
Parameters:
pTexture
(Cocos2D.CCTexture2D)usage
(Microsoft.Xna.Framework.Graphics.RenderTargetUsage)CreateRenderTarget(int, int, RenderTargetUsage)
Microsoft.Xna.Framework.Graphics.RenderTarget2D CreateRenderTarget(int, int, RenderTargetUsage)(System.Int32 width, System.Int32 height, Microsoft.Xna.Framework.Graphics.RenderTargetUsage usage)
Parameters:
width
(System.Int32)height
(System.Int32)usage
(Microsoft.Xna.Framework.Graphics.RenderTargetUsage)Returns:
Microsoft.Xna.Framework.Graphics.RenderTarget2D
CreateRenderTarget(int, int, SurfaceFormat, DepthFormat, RenderTargetUsage)
Microsoft.Xna.Framework.Graphics.RenderTarget2D CreateRenderTarget(int, int, SurfaceFormat, DepthFormat, RenderTargetUsage)(System.Int32 width, System.Int32 height, Microsoft.Xna.Framework.Graphics.SurfaceFormat colorFormat, Microsoft.Xna.Framework.Graphics.DepthFormat depthFormat, Microsoft.Xna.Framework.Graphics.RenderTargetUsage usage)
Parameters:
width
(System.Int32)height
(System.Int32)colorFormat
(Microsoft.Xna.Framework.Graphics.SurfaceFormat)depthFormat
(Microsoft.Xna.Framework.Graphics.DepthFormat)usage
(Microsoft.Xna.Framework.Graphics.RenderTargetUsage)Returns:
Microsoft.Xna.Framework.Graphics.RenderTarget2D
CreateRenderTarget(int, int, SurfaceFormat, RenderTargetUsage)
Microsoft.Xna.Framework.Graphics.RenderTarget2D CreateRenderTarget(int, int, SurfaceFormat, RenderTargetUsage)(System.Int32 width, System.Int32 height, Microsoft.Xna.Framework.Graphics.SurfaceFormat colorFormat, Microsoft.Xna.Framework.Graphics.RenderTargetUsage usage)
Parameters:
width
(System.Int32)height
(System.Int32)colorFormat
(Microsoft.Xna.Framework.Graphics.SurfaceFormat)usage
(Microsoft.Xna.Framework.Graphics.RenderTargetUsage)Returns:
Microsoft.Xna.Framework.Graphics.RenderTarget2D
CreateTexture2D(int, int)
Microsoft.Xna.Framework.Graphics.Texture2D CreateTexture2D(int, int)(System.Int32 width, System.Int32 height)
Parameters:
width
(System.Int32)height
(System.Int32)Returns:
Microsoft.Xna.Framework.Graphics.Texture2D
DrawBuffer(CCVertexBuffer, CCIndexBuffer, int, int)
DrawBuffer(CCVertexBuffer, CCIndexBuffer, int, int)(Cocos2D.CCVertexBufferT vertexBuffer, Cocos2D.CCIndexBufferT2 indexBuffer, System.Int32 start, System.Int32 count)
Parameters:
vertexBuffer
(Cocos2D.CCVertexBufferT)indexBuffer
(Cocos2D.CCIndexBufferT2)start
(System.Int32)count
(System.Int32)DrawIndexedPrimitives(PrimitiveType, T[], int, int, short[], int, int)
DrawIndexedPrimitives(PrimitiveType, T[], int, int, short[], int, int)(Microsoft.Xna.Framework.Graphics.PrimitiveType primitiveType, T[] vertexData, System.Int32 vertexOffset, System.Int32 numVertices, System.Int16[] indexData, System.Int32 indexOffset, System.Int32 primitiveCount)
Parameters:
primitiveType
(Microsoft.Xna.Framework.Graphics.PrimitiveType)vertexData
(T[])vertexOffset
(System.Int32)numVertices
(System.Int32)indexData
(System.Int16[])indexOffset
(System.Int32)primitiveCount
(System.Int32)DrawPrimitives(PrimitiveType, T[], int, int)
DrawPrimitives(PrimitiveType, T[], int, int)(Microsoft.Xna.Framework.Graphics.PrimitiveType type, T[] vertices, System.Int32 offset, System.Int32 count)
Parameters:
type
(Microsoft.Xna.Framework.Graphics.PrimitiveType)vertices
(T[])offset
(System.Int32)count
(System.Int32)DrawQuad(ref CCV3F_C4B_T2F_Quad)
DrawQuad(ref CCV3F_C4B_T2F_Quad)(Cocos2D.CCV3F_C4B_T2F_Quad quad)
Parameters:
quad
(Cocos2D.CCV3F_C4B_T2F_Quad)DrawQuads(CCRawList, int, int)
DrawQuads(CCRawList, int, int)(Cocos2D.CCRawListCocos2D.CCV3F_C4B_T2F_Quad quads, System.Int32 start, System.Int32 n)
Parameters:
quads
(Cocos2D.CCRawListCocos2D.CCV3F_C4B_T2F_Quad)start
(System.Int32)n
(System.Int32)DrawQuadsBuffer(CCVertexBuffer, int, int)
DrawQuadsBuffer(CCVertexBuffer, int, int)(Cocos2D.CCVertexBufferT vertexBuffer, System.Int32 start, System.Int32 n)
Parameters:
vertexBuffer
(Cocos2D.CCVertexBufferT)start
(System.Int32)n
(System.Int32)EndDraw()
EndDraw()()
EndDrawMask()
EndDrawMask()()
EndMask()
EndMask()()
GetRenderTarget()
Microsoft.Xna.Framework.Graphics.RenderTarget2D GetRenderTarget()()
Returns the current render target. If this is null, then your drawing is set to draw directly to the display frame buffer.
Returns:
Microsoft.Xna.Framework.Graphics.RenderTarget2D
Example
Init(GraphicsDevice)
Init(GraphicsDevice)(Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
Parameters:
graphicsDevice
(Microsoft.Xna.Framework.Graphics.GraphicsDevice)Init(IGraphicsDeviceService)
Init(IGraphicsDeviceService)(Microsoft.Xna.Framework.Graphics.IGraphicsDeviceService service)
Parameters:
service
(Microsoft.Xna.Framework.Graphics.IGraphicsDeviceService)InitializeDisplay(Game, GraphicsDeviceManager, DisplayOrientation)
InitializeDisplay(Game, GraphicsDeviceManager, DisplayOrientation)(Microsoft.Xna.Framework.Game game, Microsoft.Xna.Framework.GraphicsDeviceManager graphics, Microsoft.Xna.Framework.DisplayOrientation supportedOrientations)
Parameters:
game
(Microsoft.Xna.Framework.Game)graphics
(Microsoft.Xna.Framework.GraphicsDeviceManager)supportedOrientations
(Microsoft.Xna.Framework.DisplayOrientation)MultMatrix(CCAffineTransform, float)
MultMatrix(CCAffineTransform, float)(Cocos2D.CCAffineTransform transform, System.Single z)
Parameters:
transform
(Cocos2D.CCAffineTransform)z
(System.Single)MultMatrix(ref CCAffineTransform, float)
MultMatrix(ref CCAffineTransform, float)(Cocos2D.CCAffineTransform transform, System.Single z)
Parameters:
transform
(Cocos2D.CCAffineTransform)z
(System.Single)MultMatrix(ref Matrix)
MultMatrix(ref Matrix)(Microsoft.Xna.Framework.Matrix matrix)
Parameters:
matrix
(Microsoft.Xna.Framework.Matrix)PopEffect()
PopEffect()()
PopMatrix()
PopMatrix()()
PurgeDrawManager()
PurgeDrawManager()()
PushEffect(Effect)
PushEffect(Effect)(Microsoft.Xna.Framework.Graphics.Effect effect)
Parameters:
effect
(Microsoft.Xna.Framework.Graphics.Effect)PushMatrix()
PushMatrix()()
ResetToDisplayRenderTarget()
ResetToDisplayRenderTarget()()
Resets the default render target to be the display render target (null)
Example
ScreenToWorld(float, float)
Cocos2D.CCPoint ScreenToWorld(float, float)(System.Single x, System.Single y)
Parameters:
x
(System.Single)y
(System.Single)Returns:
Cocos2D.CCPoint
SetClearMaskState(int, bool)
SetClearMaskState(int, bool)(System.Int32 layer, System.Boolean inverted)
Parameters:
layer
(System.Int32)inverted
(System.Boolean)SetDesignResolutionSize(float, float, CCResolutionPolicy)
SetDesignResolutionSize(float, float, CCResolutionPolicy)(System.Single width, System.Single height, Cocos2D.CCResolutionPolicy resolutionPolicy)
Parameters:
width
(System.Single)height
(System.Single)resolutionPolicy
(Cocos2D.CCResolutionPolicy)SetDrawMaskState(int, bool)
SetDrawMaskState(int, bool)(System.Int32 layer, System.Boolean inverted)
Parameters:
layer
(System.Int32)inverted
(System.Boolean)SetDrawMaskedState(int, bool)
SetDrawMaskedState(int, bool)(System.Int32 layer, System.Boolean depth)
Parameters:
layer
(System.Int32)depth
(System.Boolean)SetFrameZoom(float)
SetFrameZoom(float)(System.Single zoomFactor)
Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
Parameters:
zoomFactor
(System.Single)Example
SetIdentityMatrix()
SetIdentityMatrix()()
SetOrientation(DisplayOrientation)
SetOrientation(DisplayOrientation)(Microsoft.Xna.Framework.DisplayOrientation supportedOrientations)
Parameters:
supportedOrientations
(Microsoft.Xna.Framework.DisplayOrientation)SetRenderTarget(CCTexture2D)
SetRenderTarget(CCTexture2D)(Cocos2D.CCTexture2D pTexture)
Sets the render target for all drawing to the given texture's core texture. The texture must be a RenderTarget2D or else you will get an assert/exception.
Parameters:
pTexture
(Cocos2D.CCTexture2D) - The target of future drawing, which must be a RenderTarget2DExample
SetRenderTarget(RenderTarget2D)
SetRenderTarget(RenderTarget2D)(Microsoft.Xna.Framework.Graphics.RenderTarget2D renderTarget)
Sets the render target to the given target. This is where your drawing will happen if the given parameter is not null.
Parameters:
renderTarget
(Microsoft.Xna.Framework.Graphics.RenderTarget2D)Example
SetScissorInPoints(float, float, float, float)
SetScissorInPoints(float, float, float, float)(System.Single x, System.Single y, System.Single w, System.Single h)
Parameters:
x
(System.Single)y
(System.Single)w
(System.Single)h
(System.Single)SetViewPort(int, int, int, int)
SetViewPort(int, int, int, int)(System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height)
Parameters:
x
(System.Int32)y
(System.Int32)width
(System.Int32)height
(System.Int32)SetViewPortInPoints(int, int, int, int)
SetViewPortInPoints(int, int, int, int)(System.Int32 x, System.Int32 y, System.Int32 width, System.Int32 height)
Parameters:
x
(System.Int32)y
(System.Int32)width
(System.Int32)height
(System.Int32)Translate(float, float, int)
Translate(float, float, int)(System.Single x, System.Single y, System.Int32 z)
Parameters:
x
(System.Single)y
(System.Single)z
(System.Int32)