mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 08:42:43 +08:00
Merge pull request #2633 from jareguo/master
define apisrc.json in this repo
This commit is contained in:
@@ -56,7 +56,7 @@ var HashElement = function () {
|
||||
* - 当你想要运行一个动作,但目标不是 CCNode 类型时。 <br/>
|
||||
* - 当你想要暂停/恢复动作时。 <br/>
|
||||
* @class ActionManager
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCActionManager/ActionManager.js}
|
||||
* @example {@link cocos2d/core/CCActionManager/ActionManager.js}
|
||||
*/
|
||||
cc.ActionManager = cc._Class.extend(/** @lends cc.ActionManager# */{
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ var AnimationClip = cc.Class({
|
||||
* !#zh 曲线数据。
|
||||
* @property curveData
|
||||
* @type {Object}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/animation-clip/curve-data.js}
|
||||
* @example {@link cocos2d/core/animation-clip/curve-data.js}
|
||||
*/
|
||||
curveData: {
|
||||
default: {},
|
||||
@@ -97,7 +97,7 @@ var AnimationClip = cc.Class({
|
||||
* !#zh 事件数据。
|
||||
* @property events
|
||||
* @type {Object[]}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/animation-clip/event-data.js}
|
||||
* @example {@link cocos2d/core/animation-clip/event-data.js}
|
||||
* @typescript events: {frame: number, func: string, params: string[]}[]
|
||||
*/
|
||||
events: {
|
||||
|
||||
@@ -1621,7 +1621,7 @@ var Node = cc.Class({
|
||||
* @method setPosition
|
||||
* @param {Vec2|Number} newPosOrX - X coordinate for position or the position (x, y) of the node in coordinates
|
||||
* @param {Number} [y] - Y coordinate for position
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/base-node/setPosition.js}
|
||||
* @example {@link cocos2d/core/utils/base-node/setPosition.js}
|
||||
*/
|
||||
setPosition (newPosOrX, y) {
|
||||
var x;
|
||||
|
||||
@@ -505,7 +505,7 @@ cc.Scheduler = cc._Class.extend({
|
||||
* @param {Number} [repeat=cc.macro.REPEAT_FOREVER]
|
||||
* @param {Number} [delay=0]
|
||||
* @param {Boolean} paused
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/scheduleCallbackForTarget.js}
|
||||
* @example {@link cocos2d/core/CCScheduler/scheduleCallbackForTarget.js}
|
||||
* @typescript
|
||||
* scheduleCallbackForTarget(target: any, callback: Function, interval: number, repeat: number, delay: number, paused?: boolean): void
|
||||
* scheduleCallbackForTarget(target: any, callback: Function, interval: number, paused?: boolean): void
|
||||
@@ -525,7 +525,7 @@ cc.Scheduler = cc._Class.extend({
|
||||
* @param {Number} [repeat=cc.macro.REPEAT_FOREVER]
|
||||
* @param {Number} [delay=0]
|
||||
* @param {Boolean} paused
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/schedule.js}
|
||||
* @example {@link cocos2d/core/CCScheduler/schedule.js}
|
||||
* @typescript
|
||||
* schedule(callback: Function, target: any, interval: number, repeat: number, delay: number, paused?: boolean): void
|
||||
* schedule(callback: Function, target: any, interval: number, paused?: boolean): void
|
||||
@@ -1051,7 +1051,7 @@ cc.Scheduler = cc._Class.extend({
|
||||
* @param {Object} target
|
||||
* @param {Number} priority
|
||||
* @param {Boolean} paused
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/scheduleUpdateForTarget.js}
|
||||
* @example {@link cocos2d/core/CCScheduler/scheduleUpdateForTarget.js}
|
||||
*/
|
||||
scheduleUpdateForTarget: function(target, priority, paused){
|
||||
//cc.log("scheduleUpdateForTarget is deprecated. Please use scheduleUpdate.");
|
||||
@@ -1069,7 +1069,7 @@ cc.Scheduler = cc._Class.extend({
|
||||
* @deprecated since v3.4 please use .unschedule
|
||||
* @param {Object} target
|
||||
* @param {Function} callback - callback[Function] or key[String]
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/unscheduleCallbackForTarget.js}
|
||||
* @example {@link cocos2d/core/CCScheduler/unscheduleCallbackForTarget.js}
|
||||
*/
|
||||
unscheduleCallbackForTarget: function (target, callback) {
|
||||
//cc.log("unscheduleCallbackForTarget is deprecated. Please use unschedule.");
|
||||
@@ -1082,7 +1082,7 @@ cc.Scheduler = cc._Class.extend({
|
||||
* @method unscheduleUpdateForTarget
|
||||
* @param {Object} target
|
||||
* @deprecated since v3.4 please use .unschedule
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/CCScheduler/unscheduleUpdateForTarget.js}
|
||||
* @example {@link cocos2d/core/CCScheduler/unscheduleUpdateForTarget.js}
|
||||
*/
|
||||
unscheduleUpdateForTarget: function (target) {
|
||||
//cc.log("unscheduleUpdateForTarget is deprecated. Please use unschedule.");
|
||||
|
||||
@@ -459,7 +459,7 @@ cc._EventListenerTouchAllAtOnce.LISTENER_ID = "__cc_touch_all_at_once";
|
||||
* @param {Object} argObj a json object
|
||||
* @returns {EventListener}
|
||||
* @static
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/event-manager/CCEventListener/create.js}
|
||||
* @example {@link cocos2d/core/event-manager/CCEventListener/create.js}
|
||||
*/
|
||||
cc.EventListener.create = function(argObj){
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ var __getListenerID = function (event) {
|
||||
*
|
||||
* @class eventManager
|
||||
* @static
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/event-manager/CCEventManager/addListener.js}
|
||||
* @example {@link cocos2d/core/event-manager/CCEventManager/addListener.js}
|
||||
* @deprecated
|
||||
*/
|
||||
var eventManager = {
|
||||
@@ -806,7 +806,7 @@ var eventManager = {
|
||||
* !#zh 移除一个已添加的监听器。
|
||||
* @method removeListener
|
||||
* @param {EventListener} listener - an event listener or a registered node target
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/event-manager/CCEventManager/removeListener.js}
|
||||
* @example {@link cocos2d/core/event-manager/CCEventManager/removeListener.js}
|
||||
*/
|
||||
removeListener: function (listener) {
|
||||
if (listener == null)
|
||||
|
||||
@@ -469,7 +469,7 @@ proto._isTargetActive = function (type) {
|
||||
* @method _getCapturingTargets
|
||||
* @param {String} type - the event type
|
||||
* @param {Array} array - the array to receive targets
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/event/_getCapturingTargets.js}
|
||||
* @example {@link cocos2d/core/event/_getCapturingTargets.js}
|
||||
*/
|
||||
proto._getCapturingTargets = function (type, array) {
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ var JS = require('./js');
|
||||
* @method Enum
|
||||
* @param {object} obj - a JavaScript literal object containing enum names and values, or a TypeScript enum type
|
||||
* @return {object} the defined enum type
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/platform/CCEnum/Enum.js}
|
||||
* @example {@link cocos2d/core/platform/CCEnum/Enum.js}
|
||||
* @typescript Enum<T>(obj: T): T
|
||||
*/
|
||||
function Enum (obj) {
|
||||
|
||||
@@ -31,7 +31,7 @@ require('./_CCClass');
|
||||
* !#en Key map for keyboard event
|
||||
* !#zh 键盘事件的按键值
|
||||
* @enum KEY
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/platform/CCCommon/KEY.js}
|
||||
* @example {@link cocos2d/core/platform/CCCommon/KEY.js}
|
||||
*/
|
||||
cc.KEY = {
|
||||
/**
|
||||
@@ -2003,7 +2003,7 @@ cc.defineGetterSetter(cc.macro, "BLEND_SRC", function (){
|
||||
* @param {Number} a number A
|
||||
* @param {Number} b number B
|
||||
* @param {Number} r ratio between 0 and 1
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/platform/CCMacro/lerp.js}
|
||||
* @example {@link cocos2d/core/platform/CCMacro/lerp.js}
|
||||
*/
|
||||
cc.lerp = function (a, b, r) {
|
||||
return a + (b - a) * r;
|
||||
|
||||
@@ -69,7 +69,7 @@ cc.url = {
|
||||
* @method raw
|
||||
* @param {String} url
|
||||
* @return {String}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/platform/url/raw.js}
|
||||
* @example {@link cocos2d/core/platform/url/raw.js}
|
||||
*/
|
||||
raw: function (url) {
|
||||
if (CC_EDITOR && !this._rawAssets) {
|
||||
@@ -103,7 +103,7 @@ cc.url = {
|
||||
* @method builtinRaw
|
||||
* @param {String} url
|
||||
* @return {String}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/platform/url/builtinRaw.js}
|
||||
* @example {@link cocos2d/core/platform/url/builtinRaw.js}
|
||||
*/
|
||||
builtinRaw: CC_EDITOR && function (url) {
|
||||
if ( !this._builtinRawAssets ) {
|
||||
|
||||
@@ -52,7 +52,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* @method getTextureForKey
|
||||
* @param {String} textureKeyName
|
||||
* @return {Texture2D|Null}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/getTextureForKey.js}
|
||||
* @example {@link cocos2d/core/textures/getTextureForKey.js}
|
||||
*/
|
||||
getTextureForKey: function(textureKeyName){
|
||||
return this._textures[textureKeyName];
|
||||
@@ -62,7 +62,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* @method getKeyByTexture
|
||||
* @param {HTMLImageElement} texture
|
||||
* @return {String|Null}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/getKeyByTexture.js}
|
||||
* @example {@link cocos2d/core/textures/getKeyByTexture.js}
|
||||
*/
|
||||
getKeyByTexture: function (texture) {
|
||||
for (var key in this._textures) {
|
||||
@@ -81,7 +81,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* @method getTextureColors
|
||||
* @param {HTMLImageElement} texture
|
||||
* @return {Array}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/getTextureColors.js}
|
||||
* @example {@link cocos2d/core/textures/getTextureColors.js}
|
||||
*/
|
||||
getTextureColors: function (texture) {
|
||||
var image = texture._image;
|
||||
@@ -120,7 +120,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* In the medium term: it will allocate more resources <br />
|
||||
* In the long term: it will be the same</p>
|
||||
* @method removeAllTextures
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/removeAllTextures.js}
|
||||
* @example {@link cocos2d/core/textures/removeAllTextures.js}
|
||||
*/
|
||||
removeAllTextures: function () {
|
||||
var locTextures = this._textures;
|
||||
@@ -135,7 +135,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* Deletes a texture from the cache given a texture.
|
||||
* @method removeTexture
|
||||
* @param {HTMLImageElement} texture
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/removeTexture.js}
|
||||
* @example {@link cocos2d/core/textures/removeTexture.js}
|
||||
*/
|
||||
removeTexture: function (texture) {
|
||||
if (!texture)
|
||||
@@ -154,7 +154,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* Deletes a texture from the cache given a its key name.
|
||||
* @method removeTextureForKey
|
||||
* @param {String} textureKeyName
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/removeTextureForKey.js}
|
||||
* @example {@link cocos2d/core/textures/removeTextureForKey.js}
|
||||
*/
|
||||
removeTextureForKey: function (textureKeyName) {
|
||||
if (CC_DEBUG && textureKeyName instanceof cc.Texture2D) {
|
||||
@@ -183,7 +183,7 @@ var textureCache = /** @lends cc.textureCache# */{
|
||||
* @param {Function} cb
|
||||
* @param {Object} target
|
||||
* @return {Texture2D}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/textures/addImage.js}
|
||||
* @example {@link cocos2d/core/textures/addImage.js}
|
||||
*/
|
||||
addImage (url, cb, target) {
|
||||
if (CC_DEBUG && url instanceof cc.Texture2D) {
|
||||
|
||||
@@ -41,7 +41,7 @@ cc.path = /** @lends cc.path# */{
|
||||
* !#en Join strings to be a path.
|
||||
* !#zh 拼接字符串为 Path
|
||||
* @method join
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/join.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/join.js}
|
||||
* @returns {String}
|
||||
*/
|
||||
join: function () {
|
||||
@@ -57,7 +57,7 @@ cc.path = /** @lends cc.path# */{
|
||||
* !#en Get the ext name of a path including '.', like '.png'.
|
||||
* !#zh 返回 Path 的扩展名,包括 '.',例如 '.png'。
|
||||
* @method extname
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/extname.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/extname.js}
|
||||
* @param {String} pathStr
|
||||
* @returns {*}
|
||||
*/
|
||||
@@ -87,7 +87,7 @@ cc.path = /** @lends cc.path# */{
|
||||
* !#en Get the file name of a file path.
|
||||
* !#zh 获取文件路径的文件名。
|
||||
* @method basename
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/basename.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/basename.js}
|
||||
* @param {String} pathStr
|
||||
* @param {String} [extname]
|
||||
* @returns {*}
|
||||
@@ -108,7 +108,7 @@ cc.path = /** @lends cc.path# */{
|
||||
* !#en Get dirname of a file path.
|
||||
* !#zh 获取文件路径的目录名。
|
||||
* @method dirname
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/dirname.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/dirname.js}
|
||||
* @param {String} pathStr
|
||||
* @returns {*}
|
||||
*/
|
||||
@@ -121,7 +121,7 @@ cc.path = /** @lends cc.path# */{
|
||||
* !#en Change extname of a file path.
|
||||
* !#zh 更改文件路径的扩展名。
|
||||
* @method changeExtname
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/changeExtname.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/changeExtname.js}
|
||||
* @param {String} pathStr
|
||||
* @param {String} [extname]
|
||||
* @returns {String}
|
||||
@@ -141,7 +141,7 @@ cc.path = /** @lends cc.path# */{
|
||||
/**
|
||||
* !#en Change file name of a file path.
|
||||
* !#zh 更改文件路径的文件名。
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/utils/CCPath/changeBasename.js}
|
||||
* @example {@link cocos2d/core/utils/CCPath/changeBasename.js}
|
||||
* @param {String} pathStr
|
||||
* @param {String} basename
|
||||
* @param {Boolean} [isSameExt]
|
||||
|
||||
@@ -211,7 +211,7 @@ var Color = (function () {
|
||||
* @param {number} ratio - the interpolation coefficient.
|
||||
* @param {Color} [out] - optional, the receiving vector.
|
||||
* @return {Color}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/value-types/CCColor/lerp.js}
|
||||
* @example {@link cocos2d/core/value-types/CCColor/lerp.js}
|
||||
*/
|
||||
proto.lerp = function (to, ratio, out) {
|
||||
out = out || new Color();
|
||||
@@ -347,7 +347,7 @@ var Color = (function () {
|
||||
* @method toCSS
|
||||
* @param {String} opt - "rgba", "rgb", "#rgb" or "#rrggbb".
|
||||
* @return {String}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/value-types/CCColor/toCSS.js}
|
||||
* @example {@link cocos2d/core/value-types/CCColor/toCSS.js}
|
||||
*/
|
||||
proto.toCSS = function ( opt ) {
|
||||
if ( opt === 'rgba' ) {
|
||||
@@ -630,7 +630,7 @@ cc.Color = Color;
|
||||
* @param {Number} [b=0]
|
||||
* @param {Number} [a=255]
|
||||
* @return {Color}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/value-types/CCColor/color.js}
|
||||
* @example {@link cocos2d/core/value-types/CCColor/color.js}
|
||||
*/
|
||||
cc.color = function color (r, g, b, a) {
|
||||
if (typeof r === 'string') {
|
||||
|
||||
@@ -163,7 +163,7 @@ proto.toString = function () {
|
||||
* @param {Number|Size} w - width or a size object
|
||||
* @param {Number} [h] - height
|
||||
* @return {Size}
|
||||
* @example {@link utils/api/engine/docs/cocos2d/core/value-types/CCSize/size.js}
|
||||
* @example {@link cocos2d/core/value-types/CCSize/size.js}
|
||||
*/
|
||||
cc.size = function (w, h) {
|
||||
return new Size(w, h);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
[
|
||||
"./index.js",
|
||||
"./predefine.js",
|
||||
"./CCDebugger.js",
|
||||
"./CCBoot.js",
|
||||
"./extensions/ccpool/*.js",
|
||||
"./extensions/spine/*.js",
|
||||
"./cocos2d/core/load-pipeline/*.js",
|
||||
"!./cocos2d/core/load-pipeline/asset-table.js",
|
||||
"./cocos2d/core/CCNode.js",
|
||||
"./cocos2d/core/CCActionManager.js",
|
||||
"./cocos2d/core/CCScene.js",
|
||||
"./cocos2d/core/CCGame.js",
|
||||
"./cocos2d/core/CCDirector.js",
|
||||
"./cocos2d/core/CCScheduler.js",
|
||||
"./cocos2d/core/sprites/CCSpriteFrame.js",
|
||||
"./cocos2d/core/utils/find.js",
|
||||
"./cocos2d/core/utils/base-node.js",
|
||||
"./cocos2d/animation/bezier.js",
|
||||
"./cocos2d/animation/types.js",
|
||||
"./cocos2d/animation/animation-clip.js",
|
||||
"./cocos2d/animation/animators.js",
|
||||
"./cocos2d/animation/animation-manager.js",
|
||||
"./cocos2d/animation/animation-state.js",
|
||||
"./cocos2d/animation/animation-animator.js",
|
||||
"./cocos2d/animation/playable.js",
|
||||
"./cocos2d/core/platform/**.*",
|
||||
"!./cocos2d/core/platform/_CCClass.js",
|
||||
"!./cocos2d/core/platform/CCAssetLibrary.js",
|
||||
"!./cocos2d/core/platform/CCSAXParser.js",
|
||||
"!./cocos2d/core/platform/load-manager.js",
|
||||
"!./cocos2d/core/platform/prefab-helper.js",
|
||||
"!./cocos2d/core/platform/preprocess-attrs.js",
|
||||
"!./cocos2d/core/platform/requiring-frame.js",
|
||||
"!./cocos2d/core/platform/utils.js",
|
||||
"!./cocos2d/core/platform/id-generater.js",
|
||||
"./cocos2d/core/value-types/**/*",
|
||||
"./cocos2d/core/event/**/*",
|
||||
"./cocos2d/core/assets/**/*",
|
||||
"./cocos2d/core/components/**/*",
|
||||
"./cocos2d/core/support/**/*",
|
||||
"!./cocos2d/core/support/TransformUtils.js",
|
||||
"./cocos2d/core/event-manager/**/*",
|
||||
"./cocos2d/core/textures/**/*",
|
||||
"./cocos2d/actions/**/*",
|
||||
"!./cocos2d/actions/CCActionCamera.js",
|
||||
"!./cocos2d/actions/CCActionTween.js",
|
||||
"./cocos2d/audio/*",
|
||||
"./cocos2d/particle/CCParticleSystem.js",
|
||||
"./cocos2d/tilemap/CCTiledMap.js",
|
||||
"./cocos2d/tilemap/CCTiledLayer.js",
|
||||
"./cocos2d/tilemap/CCSGTMXObject.js",
|
||||
"./cocos2d/tilemap/CCTiledObjectGroup.js",
|
||||
"./cocos2d/tilemap/CCTiledMapAsset.js",
|
||||
"./cocos2d/motion-streak/CCMotionStreak.js",
|
||||
"./cocos2d/core/collider/**/*",
|
||||
"./cocos2d/core/graphics/**/*",
|
||||
"./extensions/anysdk/*",
|
||||
"./extensions/dragonbones/*.js",
|
||||
"./cocos2d/core/physics/**/*",
|
||||
"./cocos2d/core/camera/CCCamera.js"
|
||||
]
|
||||
@@ -60,7 +60,7 @@ cc.pool = /** @lends cc.pool# */{
|
||||
* !#zh 加入对象到对象池中。
|
||||
* @method putInPool
|
||||
* @param {Object} obj - The need put in pool object.
|
||||
* @example {@link utils/api/engine/docs/extensions/ccpool/putInPool.js}
|
||||
* @example {@link extensions/ccpool/putInPool.js}
|
||||
*/
|
||||
putInPool: function (obj) {
|
||||
var cid = cc.js._getClassId(obj.constructor);
|
||||
|
||||
Reference in New Issue
Block a user