fix typos in doxygen of CCSprite and CCProtocol

This commit is contained in:
walzer 2013-01-14 21:51:47 +08:00
parent c9c227873f
commit 4ae43e5901
3 changed files with 40 additions and 28 deletions

View File

@ -55,7 +55,7 @@ public:
/** /**
* Returns the opacity. * Returns the opacity.
* *
* The opacity which indicates how transparent or opaque this sprite is. * The opacity which indicates how transparent or opaque this node is.
* 0 indicates fully transparent and 255 is fully opaque. * 0 indicates fully transparent and 255 is fully opaque.
* *
* @return The opacity of sprite, from 0 ~ 255 * @return The opacity of sprite, from 0 ~ 255
@ -65,8 +65,6 @@ public:
/** /**
* Changes the opacity. * Changes the opacity.
* *
* @warning If the the sprite's texture has premultiplied alpha then, the R, G and B channels will be modified.
*
* @param value Goes from 0 to 255, where 255 means fully opaque and 0 means fully transparent. * @param value Goes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.
*/ */
virtual void setOpacity(GLubyte opacity) = 0; virtual void setOpacity(GLubyte opacity) = 0;
@ -74,13 +72,12 @@ public:
// optional // optional
/** /**
* Changes the premultipliedAlphaOpacity property. * Changes the OpacityModifyRGB property.
* If thie property is set to true, then the rendered color will be affected by opacity.
* Normally, r = r * opacity/255, g = g * opacity/255, b = b * opacity/255.
* *
* Textures with premultiplied alpha will have this property by default on YES. * @param bValue true then the opacity will be applied as: glColor(R,G,B,opacity);
* Otherwise the default value is NO. * false then the opacity will be applied as: glColor(opacity, opacity, opacity, opacity);
*
* @param bValue If set to NO then opacity will be applied as: glColor(R,G,B,opacity);
* If set to YES then opacity will be applied as: glColor(opacity, opacity, opacity, opacity);
*/ */
virtual void setOpacityModifyRGB(bool bValue) = 0; virtual void setOpacityModifyRGB(bool bValue) = 0;
@ -102,7 +99,7 @@ class CC_DLL CCBlendProtocol
{ {
public: public:
/** /**
* Sets the source blending function for the texture. * Sets the source blending function.
* *
* @param blendFunc A structure with source and destination factor to specify pixel arithmetic, * @param blendFunc A structure with source and destination factor to specify pixel arithmetic,
* e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}. * e.g. {GL_ONE, GL_ONE}, {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}.
@ -111,7 +108,7 @@ public:
virtual void setBlendFunc(ccBlendFunc blendFunc) = 0; virtual void setBlendFunc(ccBlendFunc blendFunc) = 0;
/** /**
* Returns the blending function that is currently being used for the texture. * Returns the blending function that is currently being used.
* *
* @return A ccBlendFunc structure with source and destination factor which specified pixel arithmetic. * @return A ccBlendFunc structure with source and destination factor which specified pixel arithmetic.
*/ */
@ -119,7 +116,7 @@ public:
}; };
/** /**
* CCNode objects that uses a Texture2D to render the images. * CCNode objects that uses a CCTexture2D to render the images.
* The texture can have a blending function. * The texture can have a blending function.
* If the texture has alpha premultiplied the default blending function is: * If the texture has alpha premultiplied the default blending function is:
* src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA * src=GL_ONE dst= GL_ONE_MINUS_SRC_ALPHA

View File

@ -37,8 +37,8 @@ NS_CC_BEGIN
*/ */
typedef struct _ccColor3B typedef struct _ccColor3B
{ {
GLubyte r; GLubyte r;
GLubyte g; GLubyte g;
GLubyte b; GLubyte b;
} ccColor3B; } ccColor3B;

View File

@ -110,9 +110,8 @@ public:
static CCSprite* create(const char *pszFileName, const CCRect& rect); static CCSprite* create(const char *pszFileName, const CCRect& rect);
/** /**
* Creates a sprite with a exsiting texture contained in CCTexture2D object * Creates a sprite with an exsiting texture contained in a CCTexture2D object
* * After creation, the rect will be the size of the texture, and the offset will be (0,0).
* After creation, the rect will be the size of the texture, and thhe offset will be (0,0).
* *
* @param pTexture A pointer to a CCTexture2D object. * @param pTexture A pointer to a CCTexture2D object.
* @return A valid sprite object that is marked as autoreleased. * @return A valid sprite object that is marked as autoreleased.
@ -124,9 +123,9 @@ public:
* *
* After creation, the offset will be (0,0). * After creation, the offset will be (0,0).
* *
* @param pTexture A pointer to an exisiting CCTexture2D object. * @param pTexture A pointer to an existing CCTexture2D object.
* You can use a CCTexture2D object for many sprites. * You can use a CCTexture2D object for many sprites.
* @param rect Only the contents inside rect of this texture will be applied for this sprite. * @param rect Only the contents inside the rect of this texture will be applied for this sprite.
* @return A valid sprite object that is marked as autoreleased. * @return A valid sprite object that is marked as autoreleased.
*/ */
static CCSprite* createWithTexture(CCTexture2D *pTexture, const CCRect& rect); static CCSprite* createWithTexture(CCTexture2D *pTexture, const CCRect& rect);
@ -142,10 +141,10 @@ public:
/** /**
* Creates a sprite with an sprite frame name. * Creates a sprite with an sprite frame name.
* *
* A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. * A CCSpriteFrame will be fetched from the CCSpriteFrameCache by pszSpriteFrameName param.
* If the CCSpriteFrame doesn't exist it will raise an exception. * If the CCSpriteFrame doesn't exist it will raise an exception.
* *
* @param pszSpriteFrameName * @param pszSpriteFrameName A null terminated string which indicates the sprite frame name.
* @return A valid sprite object that is marked as autoreleased. * @return A valid sprite object that is marked as autoreleased.
*/ */
static CCSprite* createWithSpriteFrameName(const char *pszSpriteFrameName); static CCSprite* createWithSpriteFrameName(const char *pszSpriteFrameName);
@ -177,7 +176,7 @@ public:
* *
* After initialization, the rect used will be the size of the texture, and the offset will be (0,0). * After initialization, the rect used will be the size of the texture, and the offset will be (0,0).
* *
* @param pTexture A pointer to an exisiting CCTexture2D object. * @param pTexture A pointer to an existing CCTexture2D object.
* You can use a CCTexture2D object for many sprites. * You can use a CCTexture2D object for many sprites.
* @return true if the sprite is initialized properly, false otherwise. * @return true if the sprite is initialized properly, false otherwise.
*/ */
@ -196,7 +195,7 @@ public:
virtual bool initWithTexture(CCTexture2D *pTexture, const CCRect& rect); virtual bool initWithTexture(CCTexture2D *pTexture, const CCRect& rect);
/** /**
* Initializes an sprite with a texture and a rect in points, optionally rotated. * Initializes a sprite with a texture and a rect in points, optionally rotated.
* *
* After initialization, the offset will be (0,0). * After initialization, the offset will be (0,0).
* @note This is the designated initializer. * @note This is the designated initializer.
@ -217,7 +216,7 @@ public:
virtual bool initWithSpriteFrame(CCSpriteFrame *pSpriteFrame); virtual bool initWithSpriteFrame(CCSpriteFrame *pSpriteFrame);
/** /**
* Initializes an sprite with an sprite frame name. * Initializes a sprite with an sprite frame name.
* *
* A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name. * A CCSpriteFrame will be fetched from the CCSpriteFrameCache by name.
* If the CCSpriteFrame doesn't exist it will raise an exception. * If the CCSpriteFrame doesn't exist it will raise an exception.
@ -228,7 +227,7 @@ public:
virtual bool initWithSpriteFrameName(const char *pszSpriteFrameName); virtual bool initWithSpriteFrameName(const char *pszSpriteFrameName);
/** /**
* Initializes an sprite with an image filename. * Initializes a sprite with an image filename.
* *
* This method will find pszFilename from local file system, load its content to CCTexture2D, * This method will find pszFilename from local file system, load its content to CCTexture2D,
* then use CCTexture2D to create a sprite. * then use CCTexture2D to create a sprite.
@ -240,7 +239,7 @@ public:
virtual bool initWithFile(const char *pszFilename); virtual bool initWithFile(const char *pszFilename);
/** /**
* Initializes an sprite with an image filename, and a rect. * Initializes a sprite with an image filename, and a rect.
* *
* This method will find pszFilename from local file system, load its content to CCTexture2D, * This method will find pszFilename from local file system, load its content to CCTexture2D,
* then use CCTexture2D to create a sprite. * then use CCTexture2D to create a sprite.
@ -258,9 +257,25 @@ public:
/// @{ /// @{
/// @name Functions inherited from CCRGBAProtocol /// @name Functions inherited from CCRGBAProtocol
inline virtual GLubyte getOpacity() { return m_nOpacity; } inline virtual GLubyte getOpacity() { return m_nOpacity; }
/**
* Changes the opacity.
*
* @warning If the sprite's texture has premultiplied alpha then, the R, G and B channels will be modified.
*
* @param value Goes from 0 to 255, where 255 means fully opaque and 0 means fully transparent.
*/
virtual void setOpacity(GLubyte value); virtual void setOpacity(GLubyte value);
virtual ccColor3B getColor(); virtual const ccColor3B& getColor();
virtual void setColor(const ccColor3B& value); virtual void setColor(const ccColor3B& value);
/**
* Changes the premultipliedAlphaOpacity property.
*
* Textures with premultiplied alpha will have this property by default on true.
* Otherwise the default value is false.
*
* @param bValue flase then opacity will be applied as: glColor(R,G,B,opacity);
* true then opacity will be applied as: glColor(opacity, opacity, opacity, opacity);
*/
virtual void setOpacityModifyRGB(bool bValue); virtual void setOpacityModifyRGB(bool bValue);
virtual bool isOpacityModifyRGB(void); virtual bool isOpacityModifyRGB(void);
/// @} end of CCRGBAProtocol Inheritance /// @} end of CCRGBAProtocol Inheritance
@ -303,7 +318,7 @@ public:
/// @name BatchNode methods /// @name BatchNode methods
/** /**
* Updates the quad according the the rotation, position, scale values. * Updates the quad according the rotation, position, scale values.
*/ */
virtual void updateTransform(void); virtual void updateTransform(void);