惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Engineering at Meta
Engineering at Meta
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence
IT之家
IT之家
博客园 - 【当耐特】
U
Unit 42
云风的 BLOG
云风的 BLOG
L
LangChain Blog
小众软件
小众软件
Microsoft Security Blog
Microsoft Security Blog
B
Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium

博客园 - SeanLin

Cocos2d-html5资源预加载列表自动扫描脚本 [转]Git常用操作命令 Cocos2d-html5 HelloWorld模板和引擎使用简介 Javascript API Document生成工具JSDoc HTML5游戏开发涉及到的安全问题 Javascript开发的HTML5游戏的知识产权保护 CCTextureCache的多线程加载原理和使用 引擎demo任务 引擎初始化过程 引擎开发数据记录 游戏引擎消息循环机制 渲染部分 几个需要思考的问题 【转】使用Jasob混淆javascript代码 【转】html5游戏开发引擎大全 【转】V8 Javascript 引擎设计理念 android 字体位置信息 【转】蓝牙协议中HCI层的研究与开发 【转】蓝牙协议的命令和事件
JSDoc参考注释模板
SeanLin · 2012-06-11 · via 博客园 - SeanLin

1. 注释宏或者常量 

/**

 * Default Node tag

 * @constant

 * @type Number

 */

cc.CCNODE_TAG_INVALID = -1;

2. 注释的分段采用<p>,<br/>,</P> 

3.注明类和继承方式

/** 

 * @class

 * @extends cc.Class

 */

cc.Node = cc.Class.extend(/** @lends cc.Node# */{

});

4. 静态构造函数的注释

/** allocates and initializes a node.

 *

 * @constructs

 * @return {cc.Node}

 * @example

 * // example

 * var node = cc.Node.create();

 */

cc.Node.create = function () {

    return new this();

};

5. 函数方法的注释方式:

    /** converts a CCTouch (world coordinates) into a local coordiante. This method is AR (Anchor Relative).

     *

     * @param {cc.Touch}touch

     * @return {cc.Point}

     */

    convertTouchToNodeSpaceAR:function (touch) {

        var point = touch.locationInView(touch.view());

        point = cc.Director.sharedDirector().convertToGL(point);

        return this.convertToNodeSpaceAR(point);

    },

其中数据类型有:Number, Boolean, Array,String,object,function,以及引擎的自定义类型,比如cc.Node,cc.Sprite等。

6. 名字空间

 /**

 * @namespace

 */

var cc = cc = cc || {};