Class cc.Texture2D

Class Summary
Constructor Attributes Constructor Name and Description
 

This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data.

Class Detail

cc.Texture2D()

This class allows to easily create OpenGL or Canvas 2D textures from images, text or raw data.
The created cc.Texture2D object will always have power-of-two dimensions.
Depending on how you create the cc.Texture2D object, the actual image area of the texture might be smaller than the texture dimensions
i.e. "contentSize" != (pixelsWide, pixelsHigh) and (maxS, maxT) != (1.0, 1.0).
Be aware that the content of the generated textures will be upside-down!

Field Detail

{Number} height
- Content height in points
{Number} maxS
- Texture max S
{Number} maxT
- Texture max T
{WebGLTexture} name
- <@readonly> WebGLTexture Object
{Number} pixelFormat
- <@readonly> Pixel format of the texture
{Number} pixelsHeight
- <@readonly> Height in pixels
{Number} pixelsWidth
- <@readonly> Width in pixels
{cc.GLProgram} shaderProgram
- The shader program used by drawAtPoint and drawInRect
{Number} width
- Content width in points