axmol/tools/tolua++/CCProtocols.pkg

99 lines
2.5 KiB
Plaintext
Raw Normal View History

2011-06-14 14:31:25 +08:00
namespace cocos2d {
//! @brief CC RGBA protocol
class CCRGBAProtocol
{
public:
/** sets Color
@since v0.8
*/
void setColor(ccColor3B color);
/** returns the color
@since v0.8
*/
ccColor3B getColor(void);
// returns the opacity
GLubyte getOpacity(void);
/** sets the opacity.
@warning If the the texture has premultiplied alpha then, the R, G and B channels will be modifed.
Values goes from 0 to 255, where 255 means fully opaque.
*/
void setOpacity(GLubyte opacity);
// optional
/** sets the premultipliedAlphaOpacity property.
If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
If set to YES then oapcity will be applied as: glColor(opacity, opacity, opacity, opacity );
Textures with premultiplied alpha will have this property by default on YES. Otherwise the default value is NO
@since v0.8
*/
void setIsOpacityModifyRGB(bool bValue);
/** returns whether or not the opacity will be applied using glColor(R,G,B,opacity) or glColor(opacity, opacity, opacity, opacity);
@since v0.8
*/
bool getIsOpacityModifyRGB(void);
};
/**
@brief You can specify the blending fuction.
@since v0.99.0
*/
class CCBlendProtocol
{
// set the source blending function for the texture
void setBlendFunc(ccBlendFunc blendFunc);
// returns the blending function used for the texture
ccBlendFunc getBlendFunc(void);
};
/** @brief CCNode objects that uses a Texture2D to render the images.
The texture can have a blending function.
If the texture has alpha premultiplied the default blending function is:
src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA
else
src=GL_SRC_ALPHA dst= GL_ONE_MINUS_SRC_ALPHA
But you can change the blending funtion at any time.
@since v0.8.0
*/
class CCTextureProtocol : public CCBlendProtocol
{
// returns the used texture
CCTexture2D* getTexture(void);
// sets a new texture. it will be retained
void setTexture(CCTexture2D *texture);
};
//! @brief Common interface for Labels
class CCLabelProtocol
{
// sets a new label using an string
void setString(const char *label);
/** returns the string that is rendered */
const char* getString(void);
};
/** OpenGL projection protocol */
class CCProjectionProtocol : public CCObject
{
/** Called by CCDirector when the porjection is updated, and "custom" projection is used
@since v0.99.5
*/
void updateProjection(void);
};
}//namespace cocos2d