Skip to main content

CCTexture2D

CCTexture2D

Cocos2D

Inheritance: System.Object → Cocos2D.CCGraphicsResource

Implements: System.IDisposable

Constructors

CCTexture2D()

CCTexture2D()()

CCTexture2D(byte[], SurfaceFormat, bool)

CCTexture2D(byte[], SurfaceFormat, bool)(System.Byte[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Boolean mipMap)
Parameters:
data (System.Byte[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
mipMap (System.Boolean)

CCTexture2D(string)

CCTexture2D(string)(System.String fileName)
Parameters:
fileName (System.String)

Fields

DefaultAlphaPixelFormat(Microsoft.Xna.Framework.Graphics.SurfaceFormat)
OnReInit(System.Action)
OptimizeForPremultipliedAlpha(System.Boolean)
PreserveSourceSurfaceFormat(System.Boolean)

Properties

BytesPerPixelForFormat(System.UInt32)
ContentSize(Cocos2D.CCSize)
ContentSizeInPixels(Cocos2D.CCSize)

content size

HasPremultipliedAlpha(System.Boolean)

whether or not the texture has their Alpha premultiplied

IsAntialiased(System.Boolean)
IsTextureDefined(System.Boolean)
Name(Microsoft.Xna.Framework.Graphics.Texture2D)

texture name

PixelFormat(Microsoft.Xna.Framework.Graphics.SurfaceFormat)

pixel format of the texture

PixelsHigh(System.Int32)

hight in pixels

PixelsWide(System.Int32)

width in pixels

SamplerState(Microsoft.Xna.Framework.Graphics.SamplerState)
TotalBytes(System.Int32)
XNATexture(Microsoft.Xna.Framework.Graphics.Texture2D)

Methods

DetectImageFormat(Stream)

Cocos2D.CCImageFormat DetectImageFormat(Stream)(System.IO.Stream stream)
Parameters:
stream (System.IO.Stream)
Returns:
Cocos2D.CCImageFormat

Dispose()

Dispose()()
Example

GenerateMipmap()

GenerateMipmap()()

Init(int, int)

System.Boolean Init(int, int)(System.Int32 pixelsWide, System.Int32 pixelsHigh)
Parameters:
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
Returns:
System.Boolean

Init(int, int, SurfaceFormat)

System.Boolean Init(int, int, SurfaceFormat)(System.Int32 pixelsWide, System.Int32 pixelsHigh, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat)
Parameters:
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
Returns:
System.Boolean

Init(int, int, SurfaceFormat, bool)

System.Boolean Init(int, int, SurfaceFormat, bool)(System.Int32 pixelsWide, System.Int32 pixelsHigh, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Boolean premultipliedAlpha)
Parameters:
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
premultipliedAlpha (System.Boolean)
Returns:
System.Boolean

Init(int, int, SurfaceFormat, bool, bool)

System.Boolean Init(int, int, SurfaceFormat, bool, bool)(System.Int32 pixelsWide, System.Int32 pixelsHigh, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Boolean premultipliedAlpha, System.Boolean mipMap)
Parameters:
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
premultipliedAlpha (System.Boolean)
mipMap (System.Boolean)
Returns:
System.Boolean

InitWithData(byte[])

System.Boolean InitWithData(byte[])(System.Byte[] data)
Parameters:
data (System.Byte[])
Returns:
System.Boolean

InitWithData(byte[], SurfaceFormat)

System.Boolean InitWithData(byte[], SurfaceFormat)(System.Byte[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat)
Parameters:
data (System.Byte[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
Returns:
System.Boolean

InitWithData(byte[], SurfaceFormat, bool)

System.Boolean InitWithData(byte[], SurfaceFormat, bool)(System.Byte[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Boolean mipMap)
Parameters:
data (System.Byte[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
mipMap (System.Boolean)
Returns:
System.Boolean

InitWithFile(string)

System.Boolean InitWithFile(string)(System.String file)
Parameters:
file (System.String)
Returns:
System.Boolean

InitWithRawData(T[], SurfaceFormat, int, int, bool)

System.Boolean InitWithRawData(T[], SurfaceFormat, int, int, bool)(T[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Int32 pixelsWide, System.Int32 pixelsHigh, System.Boolean premultipliedAlpha)
Parameters:
data (T[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
premultipliedAlpha (System.Boolean)
Returns:
System.Boolean

InitWithRawData(T[], SurfaceFormat, int, int, bool, bool)

System.Boolean InitWithRawData(T[], SurfaceFormat, int, int, bool, bool)(T[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Int32 pixelsWide, System.Int32 pixelsHigh, System.Boolean premultipliedAlpha, System.Boolean mipMap)
Parameters:
data (T[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
premultipliedAlpha (System.Boolean)
mipMap (System.Boolean)
Returns:
System.Boolean

InitWithRawData(T[], SurfaceFormat, int, int, bool, bool, CCSize)

System.Boolean InitWithRawData(T[], SurfaceFormat, int, int, bool, bool, CCSize)(T[] data, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat, System.Int32 pixelsWide, System.Int32 pixelsHigh, System.Boolean premultipliedAlpha, System.Boolean mipMap, Cocos2D.CCSize contentSize)
Parameters:
data (T[])
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
pixelsWide (System.Int32)
pixelsHigh (System.Int32)
premultipliedAlpha (System.Boolean)
mipMap (System.Boolean)
contentSize (Cocos2D.CCSize)
Returns:
System.Boolean

InitWithStream(Stream)

System.Boolean InitWithStream(Stream)(System.IO.Stream stream)
Parameters:
stream (System.IO.Stream)
Returns:
System.Boolean

InitWithStream(Stream, SurfaceFormat)

System.Boolean InitWithStream(Stream, SurfaceFormat)(System.IO.Stream stream, Microsoft.Xna.Framework.Graphics.SurfaceFormat pixelFormat)
Parameters:
stream (System.IO.Stream)
pixelFormat (Microsoft.Xna.Framework.Graphics.SurfaceFormat)
Returns:
System.Boolean

InitWithString(string, CCSize, CCTextAlignment, CCVerticalTextAlignment, string, float)

System.Boolean InitWithString(string, CCSize, CCTextAlignment, CCVerticalTextAlignment, string, float)(System.String text, Cocos2D.CCSize dimensions, Cocos2D.CCTextAlignment hAlignment, Cocos2D.CCVerticalTextAlignment vAlignment, System.String fontName, System.Single fontSize)
Parameters:
text (System.String)
dimensions (Cocos2D.CCSize)
hAlignment (Cocos2D.CCTextAlignment)
vAlignment (Cocos2D.CCVerticalTextAlignment)
fontName (System.String)
fontSize (System.Single)
Returns:
System.Boolean

InitWithString(string, string, float)

System.Boolean InitWithString(string, string, float)(System.String text, System.String fontName, System.Single fontSize)
Parameters:
text (System.String)
fontName (System.String)
fontSize (System.Single)
Returns:
System.Boolean

InitWithTexture(Texture2D)

System.Boolean InitWithTexture(Texture2D)(Microsoft.Xna.Framework.Graphics.Texture2D texture)
Parameters:
texture (Microsoft.Xna.Framework.Graphics.Texture2D)
Returns:
System.Boolean

Reinit()

Reinit()()
Example

SaveAsJpeg(Stream, int, int)

SaveAsJpeg(Stream, int, int)(System.IO.Stream stream, System.Int32 width, System.Int32 height)
Parameters:
stream (System.IO.Stream)
width (System.Int32)
height (System.Int32)

SaveAsPng(Stream, int, int)

SaveAsPng(Stream, int, int)(System.IO.Stream stream, System.Int32 width, System.Int32 height)
Parameters:
stream (System.IO.Stream)
width (System.Int32)
height (System.Int32)

ToString()

System.String ToString()()
Returns:
System.String
Example