Merge pull request #11189 from SuYaoHui/cocosapi

Add comments
This commit is contained in:
minggo 2015-03-27 11:46:02 +08:00
commit 29c5da8429
12 changed files with 32 additions and 28 deletions

View File

@ -109,7 +109,7 @@ public:
* @param time A value between 0 and 1. * @param time A value between 0 and 1.
*/ */
virtual void update(float time); virtual void update(float time);
/** Return certain target.. /** Return certain target.
* *
* @return A certain target. * @return A certain target.
*/ */

View File

@ -124,9 +124,9 @@ public:
* @param t Duration in seconds. * @param t Duration in seconds.
* @param radius The start radius. * @param radius The start radius.
* @param deltaRadius The delta radius. * @param deltaRadius The delta radius.
* @param angelZ The start Angel in Z. * @param angleZ The start Angel in Z.
* @param deltaAngleZ The delta angle in Z. * @param deltaAngleZ The delta angle in Z.
* @param angelX The start Angel in X. * @param angleX The start Angel in X.
* @param deltaAngleX The delta angle in X. * @param deltaAngleX The delta angle in X.
* @return An OrbitCamera. * @return An OrbitCamera.
*/ */

View File

@ -168,7 +168,7 @@ public:
/** Creates an action with a Cardinal Spline array of points and tension. /** Creates an action with a Cardinal Spline array of points and tension.
* @param duration In seconds. * @param duration In seconds.
* @param point An PointArray. * @param points An PointArray.
* @param tension Goodness of fit. * @param tension Goodness of fit.
* @code * @code
* When this function bound to js or lua,the input params are changed. * When this function bound to js or lua,the input params are changed.
@ -192,7 +192,7 @@ public:
* Initializes the action with a duration and an array of points. * Initializes the action with a duration and an array of points.
* *
* @param duration In seconds. * @param duration In seconds.
* @param point An PointArray. * @param points An PointArray.
* @param tension Goodness of fit. * @param tension Goodness of fit.
*/ */
bool initWithDuration(float duration, PointArray* points, float tension); bool initWithDuration(float duration, PointArray* points, float tension);

View File

@ -45,10 +45,10 @@ class SpriteFrame;
* @{ * @{
*/ */
/** AnimationFrame /** @class AnimationFrame
* *
* A frame of the animation. It contains information like: * A frame of the animation. It contains information like:
* - sprite frame name. * - sprite frame name.
* - # of delay units. * - # of delay units.
* - offset * - offset
@ -222,7 +222,7 @@ public:
/** Sets the delay in seconds of the "delay unit". /** Sets the delay in seconds of the "delay unit".
* *
* @param setDelayPerUnit The delay in seconds of the "delay unit". * @param delayPerUnit The delay in seconds of the "delay unit".
*/ */
void setDelayPerUnit(float delayPerUnit) { _delayPerUnit = delayPerUnit; }; void setDelayPerUnit(float delayPerUnit) { _delayPerUnit = delayPerUnit; };

View File

@ -97,6 +97,7 @@ public:
* @param g Green. * @param g Green.
* @param b Blue. * @param b Blue.
* @param a Alpha. * @param a Alpha.
* @param depthValue The depth Value.
*/ */
virtual void beginWithClear(float r, float g, float b, float a, float depthValue); virtual void beginWithClear(float r, float g, float b, float a, float depthValue);
@ -129,13 +130,13 @@ public:
/** Clears the texture with a specified depth value. /** Clears the texture with a specified depth value.
* *
* @param A specified depth value. * @param depthValue A specified depth value.
*/ */
virtual void clearDepth(float depthValue); virtual void clearDepth(float depthValue);
/** Clears the texture with a specified stencil value. /** Clears the texture with a specified stencil value.
* *
* @param A specified stencil value. * @param stencilValue A specified stencil value.
*/ */
virtual void clearStencil(int stencilValue); virtual void clearStencil(int stencilValue);
@ -256,7 +257,7 @@ public:
/** Sets the Sprite being used. /** Sets the Sprite being used.
* *
* @param A Sprite. * @param sprite A Sprite.
*/ */
inline void setSprite(Sprite* sprite) { inline void setSprite(Sprite* sprite) {
CC_SAFE_RETAIN(sprite); CC_SAFE_RETAIN(sprite);

View File

@ -443,7 +443,7 @@ CC_CONSTRUCTOR_ACCESS:
* *
* @param texture A pointer to an existing Texture2D object. * @param texture A pointer to an existing Texture2D object.
* You can use a Texture2D object for many sprites. * You can use a Texture2D object for many sprites.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
*/ */
virtual bool initWithTexture(Texture2D *texture); virtual bool initWithTexture(Texture2D *texture);
@ -455,7 +455,7 @@ CC_CONSTRUCTOR_ACCESS:
* @param texture A pointer to an exisiting Texture2D object. * @param texture A pointer to an exisiting Texture2D object.
* You can use a Texture2D object for many sprites. * You can use a Texture2D 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 rect of this texture will be applied for this sprite.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
*/ */
virtual bool initWithTexture(Texture2D *texture, const Rect& rect); virtual bool initWithTexture(Texture2D *texture, const Rect& rect);
@ -468,15 +468,15 @@ CC_CONSTRUCTOR_ACCESS:
* @param texture A Texture2D object whose texture will be applied to this sprite. * @param texture A Texture2D object whose texture will be applied to this sprite.
* @param rect A rectangle assigned the contents of texture. * @param rect A rectangle assigned the contents of texture.
* @param rotated Whether or not the texture rectangle is rotated. * @param rotated Whether or not the texture rectangle is rotated.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
*/ */
virtual bool initWithTexture(Texture2D *texture, const Rect& rect, bool rotated); virtual bool initWithTexture(Texture2D *texture, const Rect& rect, bool rotated);
/** /**
* Initializes a sprite with an SpriteFrame. The texture and rect in SpriteFrame will be applied on this sprite. * Initializes a sprite with an SpriteFrame. The texture and rect in SpriteFrame will be applied on this sprite.
* *
* @param pSpriteFrame A SpriteFrame object. It should includes a valid texture and a rect. * @param spriteFrame A SpriteFrame object. It should includes a valid texture and a rect.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
*/ */
virtual bool initWithSpriteFrame(SpriteFrame *spriteFrame); virtual bool initWithSpriteFrame(SpriteFrame *spriteFrame);
@ -487,7 +487,7 @@ CC_CONSTRUCTOR_ACCESS:
* If the SpriteFrame doesn't exist it will raise an exception. * If the SpriteFrame doesn't exist it will raise an exception.
* *
* @param spriteFrameName A key string that can fected a volid SpriteFrame from SpriteFrameCache. * @param spriteFrameName A key string that can fected a volid SpriteFrame from SpriteFrameCache.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
*/ */
virtual bool initWithSpriteFrameName(const std::string& spriteFrameName); virtual bool initWithSpriteFrameName(const std::string& spriteFrameName);
@ -499,7 +499,7 @@ CC_CONSTRUCTOR_ACCESS:
* After initialization, the rect used will be the size of the image. The offset will be (0,0). * After initialization, the rect used will be the size of the image. The offset will be (0,0).
* *
* @param filename The path to an image file in local file system. * @param filename The path to an image file in local file system.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
* @js init * @js init
* @lua init * @lua init
*/ */
@ -514,7 +514,7 @@ CC_CONSTRUCTOR_ACCESS:
* *
* @param filename The path to an image file in local file system. * @param filename The path to an image file in local file system.
* @param rect The rectangle assigned the content area from texture. * @param rect The rectangle assigned the content area from texture.
* @return true if the sprite is initialized properly, false otherwise. * @return True if the sprite is initialized properly, false otherwise.
* @js init * @js init
* @lua init * @lua init
*/ */

View File

@ -226,7 +226,7 @@ public:
/** Set tileset information for the layer. /** Set tileset information for the layer.
* *
* @param The tileset information for the layer. * @param info The tileset information for the layer.
*/ */
inline void setTileSet(TMXTilesetInfo* info) { inline void setTileSet(TMXTilesetInfo* info) {
CC_SAFE_RETAIN(info); CC_SAFE_RETAIN(info);

View File

@ -63,7 +63,7 @@ public:
/** Set the group name. /** Set the group name.
* *
* @param groupname A string,it is used to set the group name. * @param groupName A string,it is used to set the group name.
*/ */
inline void setGroupName(const std::string& groupName){ _groupName = groupName; } inline void setGroupName(const std::string& groupName){ _groupName = groupName; }

View File

@ -201,7 +201,7 @@ public:
/** Set the tiles's size property measured in pixels. /** Set the tiles's size property measured in pixels.
* *
* @param The tiles's size property measured in pixels. * @param tileSize The tiles's size property measured in pixels.
*/ */
inline void setTileSize(const Size& tileSize) { _tileSize = tileSize; }; inline void setTileSize(const Size& tileSize) { _tileSize = tileSize; };

View File

@ -37,7 +37,7 @@ NS_CC_BEGIN
/** /**
* @brief Returns a Core Graphics rectangle structure corresponding to the data in a given string. * @brief Returns a Core Graphics rectangle structure corresponding to the data in a given string.
* @param pszContent A string object whose contents are of the form "{{x,y},{w, h}}", * @param str A string object whose contents are of the form "{{x,y},{w, h}}",
* where x is the x coordinate, y is the y coordinate, w is the width, and h is the height. * where x is the x coordinate, y is the y coordinate, w is the width, and h is the height.
* These components can represent integer or float values. * These components can represent integer or float values.
* An example of a valid string is "{{3,2},{4,5}}". * An example of a valid string is "{{3,2},{4,5}}".
@ -49,7 +49,7 @@ Rect CC_DLL RectFromString(const std::string& str);
/** /**
* @brief Returns a Core Graphics point structure corresponding to the data in a given string. * @brief Returns a Core Graphics point structure corresponding to the data in a given string.
* @param pszContent A string object whose contents are of the form "{x,y}", * @param str A string object whose contents are of the form "{x,y}",
* where x is the x coordinate and y is the y coordinate. * where x is the x coordinate and y is the y coordinate.
* The x and y values can represent integer or float values. * The x and y values can represent integer or float values.
* An example of a valid string is "{3.0,2.5}". * An example of a valid string is "{3.0,2.5}".
@ -61,7 +61,7 @@ Vec2 CC_DLL PointFromString(const std::string& str);
/** /**
* @brief Returns a Core Graphics size structure corresponding to the data in a given string. * @brief Returns a Core Graphics size structure corresponding to the data in a given string.
* @param pszContent A string object whose contents are of the form "{w, h}", * @param str A string object whose contents are of the form "{w, h}",
* where w is the width and h is the height. * where w is the width and h is the height.
* The w and h values can be integer or float values. * The w and h values can be integer or float values.
* An example of a valid string is "{3.0,2.5}". * An example of a valid string is "{3.0,2.5}".

View File

@ -90,7 +90,7 @@ THE SOFTWARE.
#define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0 #define CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL 0
#endif #endif
/** @def CC_DIRECTOR_FPS_INTERVAL /** @def CC_DIRECTOR_STATS_INTERVAL
* Seconds between FPS updates. * Seconds between FPS updates.
* 0.5 seconds, means that the FPS number will be updated every 0.5 seconds. * 0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
* Having a bigger number means a more reliable FPS. * Having a bigger number means a more reliable FPS.
@ -284,7 +284,7 @@ THE SOFTWARE.
/** @def CC_CONSTRUCTOR_ACCESS /** @def CC_CONSTRUCTOR_ACCESS
* Indicate the init functions access modifier. If value equals to protected, then these functions are protected. * Indicate the init functions access modifier. If value equals to protected, then these functions are protected.
* If value equals to public, these functions are public * If value equals to public, these functions are public,
* protected by default. * protected by default.
*/ */
#ifndef CC_CONSTRUCTOR_ACCESS #ifndef CC_CONSTRUCTOR_ACCESS

View File

@ -70,7 +70,10 @@ enum class ResolutionPolicy
UNKNOWN, UNKNOWN,
}; };
/** @struct GLContextAttrs Have six opengl Context Attrs. */ /** @struct GLContextAttrs
*
* There are six opengl Context Attrs.
*/
struct GLContextAttrs struct GLContextAttrs
{ {
int redBits; int redBits;