-
Notifications
You must be signed in to change notification settings - Fork 421
CAImage
CAImage texture class (namely the texture in memory) is mainly used to create texture object and load image into memory. It’s the base of all related texture class.
CAObject
Access modifier |
Method name |
Description |
public |
create |
Create texture |
public |
description |
Texture description |
public |
releaseData |
Release data |
public |
keepData |
Save data |
public |
drawAtPoint |
Draw texture at appointed position |
public |
drawInRect |
Draw appointed region on texture |
public |
stringForFormat |
Pixel format |
public |
bitsPerPixelForFormat |
Pixel bit depth |
public |
bitsPerPixelForFormat |
Pixel depth of appointed format |
public |
getContentSizeInPixels |
Obtain pixel size |
Return value: CAImage*
Parameter:
Type |
Parameter |
Description |
const char* |
file |
Use to create texture file name |
const char description(void)*
Return value: const char*
Description: text description
void releaseData(void *data)
Return value: void
Parameter:
Type |
Parameter name |
Description |
void* |
data |
Any pointer type |
void keepData(void *data, unsigned int length)*
Return value: void
Parameter:
Type |
Parameter name |
Description |
Void* |
Data |
Any pointer type |
void drawAtPoint(const CCPoint& point)
Return value: void
Parameter:
Type |
Parameter name |
Description |
const CCPoint |
point |
point |
Return value: void
Parameter:
Type |
Parameter name |
Description |
const CCRect |
rect |
Draw-required region on texture |
const char stringForFormat()*
Return value: const char*
Description: obtain texture pixel format
unsigned int bitsPerPixelForFormat()
Return value: unsigned int
Description: obtain pixel bit depth, namely the bit number for each pixel.
unsigned int bitsPerPixelForFormat(CCTexture2DPixelFormat format)
Return value: unsigned int
Parameter:
Type |
Parameter name |
Description |
CCTexture2DPixelFormat |
format |
Appointed pixel format |
const CCSize& getContentSizeInPixels()
Return value: const CCSize
Description: obtain texture pixel’s width and height