Merge pull request #10998 from dingpinglv/Iss_Annotate

[ci skip] Added js annotates to -x
This commit is contained in:
minggo 2015-03-19 22:09:43 +08:00
commit d28e5d61b6
8 changed files with 46 additions and 11 deletions

View File

@ -57,6 +57,9 @@ enum class LightFlag
LIGHT15 = 1 << 15,
};
/**
@js NA
*/
class CC_DLL BaseLight : public Node
{
public:
@ -95,6 +98,9 @@ protected:
bool _enabled;
};
/**
@js NA
*/
class CC_DLL DirectionLight : public BaseLight
{
public:
@ -133,6 +139,9 @@ CC_CONSTRUCTOR_ACCESS:
};
/**
@js NA
*/
class CC_DLL PointLight : public BaseLight
{
public:
@ -161,6 +170,9 @@ protected:
float _range;
};
/**
@js NA
*/
class CC_DLL SpotLight : public BaseLight
{
public:
@ -252,6 +264,9 @@ protected:
float _cosOuterAngle;
};
/**
@js NA
*/
class CC_DLL AmbientLight : public BaseLight
{
public:

View File

@ -72,6 +72,7 @@ public:
*
* @param size The predefined size of scene.
* @return An autoreleased Scene object.
* @js NA
*/
static Scene *createWithSize(const Size& size);
@ -81,24 +82,25 @@ public:
/** Get all cameras.
*
* @return The vector of all cameras.
* @js NA
*/
const std::vector<Camera*>& getCameras() const { return _cameras; }
/** Get the default camera.
*
* @js NA
* @return The default camera of scene.
*/
Camera* getDefaultCamera() const { return _defaultCamera; }
/** Get lights.
*
* @return The vector of lights.
* @js NA
*/
const std::vector<BaseLight*>& getLights() const { return _lights; }
/** Render the scene.
*
* @param renderer The renderer use to render the scene.
* @js NA
*/
void render(Renderer* renderer);
@ -139,14 +141,14 @@ public:
virtual void addChild(Node* child, int zOrder, int tag) override;
virtual void addChild(Node* child, int zOrder, const std::string &name) override;
/** Get the physics world of the scene.
*
* @return The physics world of the scene.
* @js NA
*/
inline PhysicsWorld* getPhysicsWorld() { return _physicsWorld; }
/** Create a scene with physics.
*
* @return An autoreleased Scene object with physics.
* @js NA
*/
static Scene *createWithPhysics();

View File

@ -55,6 +55,7 @@ class Texture2D;
* @brief Singleton that handles the loading of the sprite frames.
It saves in a cache the sprite frames.
@since v0.9
@js cc.spriteFrameCache
*/
class CC_DLL SpriteFrameCache : public Ref
{
@ -62,17 +63,23 @@ public:
/** Returns the shared instance of the Sprite Frame cache.
*
* @return The instance of the Sprite Frame Cache.
* @js NA
*/
static SpriteFrameCache* getInstance();
/** @deprecated Use getInstance() instead */
/** @deprecated Use getInstance() instead
@js NA
*/
CC_DEPRECATED_ATTRIBUTE static SpriteFrameCache* sharedSpriteFrameCache() { return SpriteFrameCache::getInstance(); }
/** Destroys the cache. It releases all the Sprite Frames and the retained instance.
* @js NA
*/
static void destroyInstance();
/** @deprecated Use destroyInstance() instead */
/** @deprecated Use destroyInstance() instead
* @js NA
*/
CC_DEPRECATED_ATTRIBUTE static void purgeSharedSpriteFrameCache() { return SpriteFrameCache::destroyInstance(); }
/** Destructor.
@ -117,7 +124,7 @@ public:
void addSpriteFramesWithFile(const std::string&plist, Texture2D *texture);
/** Adds multiple Sprite Frames from a plist file content. The texture will be associated with the created sprite frames.
* @js addSpriteFrames
* @js NA
* @lua addSpriteFrames
*
* @param plist_content Plist file content string.
@ -144,6 +151,7 @@ public:
/** Removes unused sprite frames.
* Sprite Frames that have a retain count of 1 will be deleted.
* It is convenient to call this method after when starting a new Scene.
* @js NA
*/
void removeUnusedSpriteFrames();
@ -167,6 +175,7 @@ public:
* It is convenient to call this method when a specific texture needs to be removed.
*
* @param plist_content The string of the plist content that needs to removed.
* @js NA
*/
void removeSpriteFramesFromFileContent(const std::string& plist_content);

View File

@ -50,6 +50,7 @@ namespace CocosDenshion {
* @brief Offers a very simple interface to play background music & sound effects.
*
* @note Make sure to call SimpleAudioEngine::end() when the sound engine is not needed anymore to release allocated resources.
* @js cc.audioEngine
*/
class EXPORT_DLL SimpleAudioEngine

View File

@ -41,6 +41,7 @@ class EventDispatcher;
/**
* @class Controller
* @brief A Controller object represents a connected physical game controller.
* @js NA
*/
class Controller
{

View File

@ -209,7 +209,6 @@ public:
/** 'update' the scheduler.
* You should NEVER call this method, unless you know what you are doing.
* @js NA
* @lua NA
*/
void update(float dt);
@ -330,7 +329,6 @@ public:
This also includes the "update" selector.
@param target The target to be unscheduled.
@since v0.99.3
@js unscheduleCallbackForTarget
@lua NA
*/
void unscheduleAllForTarget(void *target);
@ -400,7 +398,6 @@ public:
* @param target The target to be checked.
* @return True if the target is paused, false if not.
* @since v1.0.0
* @js isTargetPaused(var jsObject)
* @lua NA
*/
bool isTargetPaused(void *target);
@ -430,6 +427,7 @@ public:
This function is thread safe.
@param function The function to be run in cocos2d thread.
@since v3.0
@js NA
*/
void performFunctionInCocosThread( const std::function<void()> &function);
@ -445,6 +443,7 @@ public:
delay is the amount of time the action will wait before it'll start
@deprecated Please use `Scheduler::schedule` instead.
@since v0.99.3, repeat and delay added in v1.1
@js NA
*/
CC_DEPRECATED_ATTRIBUTE void scheduleSelector(SEL_SCHEDULE selector, Ref *target, float interval, unsigned int repeat, float delay, bool paused)
{
@ -453,6 +452,7 @@ public:
/** Calls scheduleSelector with CC_REPEAT_FOREVER and a 0 delay.
* @deprecated Please use `Scheduler::schedule` instead.
* @js NA
*/
CC_DEPRECATED_ATTRIBUTE void scheduleSelector(SEL_SCHEDULE selector, Ref *target, float interval, bool paused)
{
@ -472,12 +472,14 @@ public:
If you want to unschedule the "update", use unscheudleUpdateForTarget.
@deprecated Please use 'Scheduler::unschedule' instead.
@since v0.99.3
@js NA
*/
CC_DEPRECATED_ATTRIBUTE void unscheduleSelector(SEL_SCHEDULE selector, Ref *target) { unschedule(selector, target); };
/** Checks whether a selector for a given taget is scheduled.
@deprecated Please use 'Scheduler::isScheduled' instead.
@since v0.99.3
@js NA
*/
CC_DEPRECATED_ATTRIBUTE bool isScheduledForTarget(Ref *target, SEL_SCHEDULE selector) { return isScheduled(selector, target); };
@ -494,6 +496,7 @@ protected:
The lower the priority, the earlier it is called.
@note This method is only for internal use.
@since v3.0
@js _schedulePerFrame
*/
void schedulePerFrame(const ccSchedulerFunc& callback, void *target, int priority, bool paused);

View File

@ -36,6 +36,7 @@ class EventListenerCustom;
/**
VertexBuffer is an abstraction of low level openGL Vertex Buffer Object.
It is used to save an array of vertices.
*@js NA
*/
class CC_DLL VertexBuffer : public Ref
{
@ -133,6 +134,7 @@ public:
/**
IndexBuffer is an abstraction of low level openGL Buffer Object.
It used to save an array of indices.
@js NA
*/
class CC_DLL IndexBuffer : public Ref
{

View File

@ -42,6 +42,7 @@ glVertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized
_offset is used to compute the start offset in a interleaved array, take a V3F_C4B_T2F array,
offset of vertex will be 0, offset of color would be 0 + sizeof(float) * 3 = 12,
offset of texture coord would be 12 + sizeof(char) * 4 = 16.
@js NA
*/
struct CC_DLL VertexStreamAttribute
{
@ -101,6 +102,7 @@ struct CC_DLL VertexStreamAttribute
VertexData is a class used for specify input streams for GPU rendering pipeline,
a VertexData will be composed by several streams, every stream will contain a VertexStreamAttribute
and the binding VertexBuffer. Streams will be identified by semantic.
@js NA
*/
class CC_DLL VertexData : public Ref