mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
+11
-2
@@ -12,9 +12,15 @@ Core Developers:
|
||||
|
||||
Sijie Wang (@VisualSJ)
|
||||
|
||||
Long Jiang (@jianglong0156)
|
||||
Huabing Xu (@dabingnn)
|
||||
|
||||
Menghe Zhang (@ZhangMenghe)
|
||||
Guanghui Qu (@zilongshanren)
|
||||
|
||||
Jiawei Guo (@jareguo)
|
||||
|
||||
Kaile Yin (@2youyouo2)
|
||||
|
||||
Yanbin Huang (@knoxHuang)
|
||||
|
||||
Contributors:
|
||||
Name GithubID Main contribution
|
||||
@@ -277,9 +283,12 @@ Maxim Litvinov @metalim Throw new Error object instead of error mess
|
||||
Retired Core Developers:
|
||||
Shengxiang Chen (Nero Chan)
|
||||
Xingsen Ma
|
||||
Xiaojun Zheng
|
||||
Jialong Zhai (@JoshuaAstray)
|
||||
Hao Wu (WuHao)
|
||||
Dingping Lv (David Lv)
|
||||
Long Jiang (@jianglong0156)
|
||||
Menghe Zhang (@ZhangMenghe)
|
||||
|
||||
Cocos2d-x and cocos2d-html5 can not grow so fast without the active community.
|
||||
|
||||
|
||||
+12
-43
@@ -1,51 +1,20 @@
|
||||
Cocos Creator Game Engine
|
||||
Cocos Creator Engine Framework
|
||||
==================
|
||||
|
||||
[Cocos2d-html5][1] is a cross-platform 2D game engine written in Javascript, based on [Cocos2d-X][2] and licensed under MIT.
|
||||
It incorporates the same high level api as “Cocos2d JS-binding engine” and compatible with Cocos2d-X.
|
||||
It currently supports canvas and WebGL renderer.
|
||||
This repo is the engine framework for Cocos Creator, Cocos Creator is a game development tool focused on content creation, which has realized features like thorough scriptability, componentization and data driven, etc. on the basis of Cocos2d-x.
|
||||
|
||||
Cross Platform
|
||||
-------------
|
||||
* Popular browsers: Chrome 14+, Safari 5.0+, IE9+, Firefox 3.5+.
|
||||
* Mobile platforms: coming soon.
|
||||
* Native App: Same piece of code can run on "Cocos2d JS-Binding Engine" without or with little modification.
|
||||
Cocos Creator's in-editor scene view and web runtime share the same framework, which is the content of this repo. It's originally forked from [Cocos2d-html5](https://github.com/cocos2d/cocos2d-html5/), we build up an Entity Component architecture on it to meet the needs of Cocos Creator.
|
||||
|
||||
Documentation
|
||||
------------------
|
||||
* Website: [www.cocos2d-x.org][3]
|
||||
* API References: [http://www.cocos2d-x.org/wiki/Reference] [4]
|
||||
This framework is a cross-platform game engine written in Javascript and licensed under MIT. It supports major desktop and mobile browsers, it's also compatible with Cocos2d Javascript Binding engine to support native platforms like iOS, Android, Win32, Mac OS X.
|
||||
|
||||
The framework is naturally integrated with Cocos Creator, so it's not designed to be used independently.
|
||||
|
||||
Installing from [bower][8] (version >=3.4)
|
||||
Links
|
||||
------------------
|
||||
|
||||
```shell
|
||||
$ bower install cocos2d-html5
|
||||
```
|
||||
|
||||
Running the tests (version <3)
|
||||
------------------
|
||||
|
||||
```shell
|
||||
$ git clone git://github.com/fireball-x/engine.git
|
||||
$ cd engine
|
||||
$ python -m SimpleHTTPServer
|
||||
```
|
||||
... and then open a browser and go to `http://localhost:8000/tests`
|
||||
|
||||
|
||||
Contact us
|
||||
------------------
|
||||
* Forum: [http://forum.cocos2d-x.org][5]
|
||||
* Twitter: [http://www.twitter.com/cocos2dhtml5][6]
|
||||
* Sina Microblog: [http://t.sina.com.cn/cocos2dhtml5][7]
|
||||
|
||||
[1]: http://www.cocos2d-x.org "Cocos2d-html5"
|
||||
[2]: http://www.cocos2d-x.org "Cocos2d-X"
|
||||
[3]: http://www.cocos2d-x.org "www.cocos2d-x.org"
|
||||
[4]: http://www.cocos2d-x.org/wiki/Reference "API References"
|
||||
[5]: http://forum.cocos2d-x.org "http://forum.cocos2d-x.org"
|
||||
[6]: http://www.twitter.com/cocos2dhtml5 "http://www.twitter.com/cocos2dhtml5"
|
||||
[7]: http://t.sina.com.cn/cocos2dhtml5 "http://t.sina.com.cn/cocos2dhtml5"
|
||||
[8]: http://bower.io "http://bower.io"
|
||||
* [Official site](http://cocos2d-x.org/)
|
||||
* [Download](http://cocos2d-x.org/download)
|
||||
* [Documentation](http://cocos2d-x.org/docs/editors_and_tools/creator/index.html)
|
||||
* [API References](http://cocos2d-x.org/docs/api-ref/creator/v0.71/)
|
||||
* [Forum](http://discuss.cocos2d-x.org/c/editors-and-tools/cocos-creator)
|
||||
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
{
|
||||
"name": "cocos2d-html5",
|
||||
"homepage": "http://www.cocos2d-x.org",
|
||||
"authors": [
|
||||
"AUTHORS.txt"
|
||||
],
|
||||
"description": "Cocos2d-html5 is a cross-platform 2D game engine written in Javascript, based on Cocos2d-X and licensed under MIT. It incorporates the same high level api as “Cocos2d JS-binding engine” and compatible with Cocos2d-X. It currently supports canvas and WebGL renderering.",
|
||||
"main": "README.mdown",
|
||||
"keywords": [
|
||||
"cocos2d-x",
|
||||
"cocos2d",
|
||||
"game",
|
||||
"engine",
|
||||
"opengl",
|
||||
"cross",
|
||||
"multi",
|
||||
"platform",
|
||||
"iphone",
|
||||
"ipad",
|
||||
"android",
|
||||
"windows",
|
||||
"metro",
|
||||
"bada",
|
||||
"marmalade",
|
||||
"playbook"
|
||||
],
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
||||
+54
-32
@@ -334,11 +334,17 @@ JS.mixin(cc.Audio.prototype, {
|
||||
(function(polyfill){
|
||||
|
||||
var SWA = polyfill.WEB_AUDIO,
|
||||
SWB = polyfill.MULTI_CHANNEL,
|
||||
SWC = polyfill.AUTOPLAY;
|
||||
|
||||
/**
|
||||
* cc.audioEngine is the singleton object, it provide simple audio APIs.
|
||||
* !#en cc.audioEngine is the singleton object, it provide simple audio APIs.
|
||||
* !#zn
|
||||
* cc.audioengine是单例对象。<br/>
|
||||
* 主要用来播放背景音乐和音效,背景音乐同一时间只能播放一个,而音效则可以同时播放多个。<br/>
|
||||
* 注意:<br/>
|
||||
* 在 Android 系统浏览器上,不同浏览器,不同版本的效果不尽相同。<br/>
|
||||
* 比如说:大多数浏览器都需要用户物理交互才可以开始播放音效,有一些不支持 WebAudio,<br/>
|
||||
* 有一些不支持多音轨播放。总之如果对音乐依赖比较强,请做尽可能多的测试。
|
||||
* @class audioEngine
|
||||
* @static
|
||||
*/
|
||||
@@ -349,17 +355,13 @@ JS.mixin(cc.Audio.prototype, {
|
||||
features: polyfill,
|
||||
|
||||
/**
|
||||
* Indicates whether any background music can be played or not.
|
||||
* @method willPlayMusic
|
||||
* @returns {boolean} <i>true</i> if the background music is playing, otherwise <i>false</i>
|
||||
*/
|
||||
willPlayMusic: function(){return false;},
|
||||
|
||||
/**
|
||||
* Play music.
|
||||
* !#en Play music.
|
||||
* !#zh
|
||||
* 播放指定音乐,并可以设置是否循环播放。<br/>
|
||||
* 注意:音乐播放接口不支持多音轨,同一时间只能播放一个音乐。
|
||||
* @method playMusic
|
||||
* @param {String} url The path of the music file without filename extension.
|
||||
* @param {Boolean} loop Whether the music loop or not.
|
||||
* @param {String} url - The path of the music file without filename extension.
|
||||
* @param {Boolean} loop - Whether the music loop or not.
|
||||
* @example
|
||||
* //example
|
||||
* cc.audioEngine.playMusic(path, false);
|
||||
@@ -391,9 +393,10 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop playing music.
|
||||
* !#en Stop playing music.
|
||||
* !#zh 停止当前音乐。
|
||||
* @method stopMusic
|
||||
* @param {Boolean} [releaseData] If release the music data or not.As default value is false.
|
||||
* @param {Boolean} [releaseData] - If release the music data or not.As default value is false.
|
||||
* @example
|
||||
* //example
|
||||
* cc.audioEngine.stopMusic();
|
||||
@@ -408,7 +411,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Pause playing music.
|
||||
* !#en Pause playing music.
|
||||
* !#zh 暂停正在播放音乐。
|
||||
* @method pauseMusic
|
||||
* @example
|
||||
* //example
|
||||
@@ -421,7 +425,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Resume playing music.
|
||||
* !#en Resume playing music.
|
||||
* !#zh 恢复音乐播放。
|
||||
* @method resumeMusic
|
||||
* @example
|
||||
* //example
|
||||
@@ -434,7 +439,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Rewind playing music.
|
||||
* !#en Rewind playing music.
|
||||
* !#zh 从头开始重新播放当前音乐。
|
||||
* @method rewindMusic
|
||||
* @example
|
||||
* //example
|
||||
@@ -449,7 +455,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* The volume of the music max value is 1.0,the min value is 0.0 .
|
||||
* !#en The volume of the music max value is 1.0,the min value is 0.0 .
|
||||
* !#zh 获取音量(0.0 ~ 1.0)。
|
||||
* @method getMusicVolume
|
||||
* @return {Number}
|
||||
* @example
|
||||
@@ -461,7 +468,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the volume of music.
|
||||
* !#en Set the volume of music.
|
||||
* !#zh 设置音量(0.0 ~ 1.0)。
|
||||
* @method setMusicVolume
|
||||
* @param {Number} volume Volume must be in 0.0~1.0 .
|
||||
* @example
|
||||
@@ -482,7 +490,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Whether the music is playing.
|
||||
* !#en Whether the music is playing.
|
||||
* !#zh 音乐是否正在播放。
|
||||
* @method isMusicPlaying
|
||||
* @return {Boolean} If is playing return true,or return false.
|
||||
* @example
|
||||
@@ -507,7 +516,10 @@ JS.mixin(cc.Audio.prototype, {
|
||||
_maxAudioInstance: 5,
|
||||
_effectVolume: 1,
|
||||
/**
|
||||
* Play sound effect.
|
||||
* !#en Play sound effect.
|
||||
* !#zh
|
||||
* 播放指定音效,并可以设置是否循环播放。<br/>
|
||||
* 注意:在部分不支持多音轨的浏览器上,这个接口会失效,请使用 playMusic
|
||||
* @method playEffect
|
||||
* @param {String} url The path of the sound effect with filename extension.
|
||||
* @param {Boolean} loop Whether to loop the effect playing, default value is false
|
||||
@@ -518,7 +530,7 @@ JS.mixin(cc.Audio.prototype, {
|
||||
*/
|
||||
playEffect: function(url, loop){
|
||||
//If the browser just support playing single audio
|
||||
if(!SWB){
|
||||
if(!polyfill.MULTI_CHANNEL){
|
||||
//Must be forced to shut down
|
||||
//Because playing MULTI_CHANNEL audio will be stuck in chrome 28 (android)
|
||||
return null;
|
||||
@@ -564,7 +576,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Set the volume of sound effects.
|
||||
* !#en Set the volume of sound effects.
|
||||
* !#zh 设置音效音量(0.0 ~ 1.0)。
|
||||
* @method setEffectsVolume
|
||||
* @param {Number} volume Volume must be in 0.0~1.0 .
|
||||
* @example
|
||||
@@ -589,7 +602,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* The volume of the effects max value is 1.0,the min value is 0.0 .
|
||||
* !#en The volume of the effects max value is 1.0,the min value is 0.0 .
|
||||
* !#zh 获取音效音量(0.0 ~ 1.0)。
|
||||
* @method getEffectsVolume
|
||||
* @return {Number}
|
||||
* @example
|
||||
@@ -601,7 +615,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Pause playing sound effect.
|
||||
* !#en Pause playing sound effect.
|
||||
* !#zh 暂停指定的音效。
|
||||
* @method pauseEffect
|
||||
* @param {Number} audio - The return value of function playEffect.
|
||||
* @example
|
||||
@@ -615,7 +630,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Pause all playing sound effect.
|
||||
* !#en Pause all playing sound effect.
|
||||
* !#zh 暂停现在正在播放的所有音效。
|
||||
* @method pauseAllEffects
|
||||
* @example
|
||||
* //example
|
||||
@@ -634,7 +650,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Resume playing sound effect.
|
||||
* !#en Resume playing sound effect.
|
||||
* !#zh 恢复播放指定的音效。
|
||||
* @method resumeEffect
|
||||
* @param {Number} audioID - The return value of function playEffect.
|
||||
* @audioID
|
||||
@@ -647,7 +664,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Resume all playing sound effect
|
||||
* !#en Resume all playing sound effect.
|
||||
* !#zh 恢复播放所有之前暂停的所有音效。
|
||||
* @method resumeAllEffects
|
||||
* @example
|
||||
* //example
|
||||
@@ -664,7 +682,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop playing sound effect.
|
||||
* !#en Stop playing sound effect.
|
||||
* !#zh 停止播放指定音效。
|
||||
* @method stopEffect
|
||||
* @param {Number} audioID - The return value of function playEffect.
|
||||
* @example
|
||||
@@ -677,7 +696,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Stop all playing sound effects.
|
||||
* !#en Stop all playing sound effects.
|
||||
* !#zh 停止正在播放的所有音效。
|
||||
* @method stopAllEffects
|
||||
* @example
|
||||
* //example
|
||||
@@ -694,7 +714,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* Unload the preloaded effect from internal buffer
|
||||
* !#en Unload the preloaded effect from internal buffer.
|
||||
* !#zh 卸载预加载的音效。
|
||||
* @method unloadEffect
|
||||
* @param {String} url
|
||||
* @example
|
||||
@@ -713,7 +734,8 @@ JS.mixin(cc.Audio.prototype, {
|
||||
},
|
||||
|
||||
/**
|
||||
* End music and effects.
|
||||
* !#en End music and effects.
|
||||
* !#zh 停止所有音乐和音效的播放。
|
||||
* @method end
|
||||
*/
|
||||
end: function(){
|
||||
|
||||
@@ -680,7 +680,7 @@ cc.Director = Class.extend(/** @lends cc.Director# */{
|
||||
scene = sceneAsset;
|
||||
}
|
||||
if (scene instanceof cc.Scene) {
|
||||
self.runScene(scene, onUnloaded, onLaunched);
|
||||
self.runSceneImmediate(scene, onUnloaded, onLaunched);
|
||||
}
|
||||
else {
|
||||
error = 'The asset ' + uuid + ' is not a scene';
|
||||
|
||||
+122
-27
@@ -312,10 +312,13 @@ function findChildComponents (children, constructor, components) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Class of all entities in Cocos Creator scenes.
|
||||
* !#en
|
||||
* Class of all entities in Cocos Creator scenes.<br/>
|
||||
* Node also inherits from {{#crossLink "EventTarget"}}Event Target{{/crossLink}}, it permits Node to dispatch events.
|
||||
* For events supported by Node, please refer to {{#crossLink "Node.EventType"}}{{/crossLink}}
|
||||
*
|
||||
* !#zh
|
||||
* Cocos Creator 场景中的所有节点类。节点也继承了 {{#crossLink "EventTarget"}}EventTarget{{/crossLink}},它允许节点发送事件。<br/>
|
||||
* 支持的节点事件,请参阅 {{#crossLink "Node.EventType"}}{{/crossLink}}。
|
||||
* @class Node
|
||||
* @extends _BaseNode
|
||||
*/
|
||||
@@ -326,10 +329,19 @@ var Node = cc.Class({
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* The local active state of this node.
|
||||
* !#en
|
||||
* The local active state of this node.<br/>
|
||||
* Note that a Node may be inactive because a parent is not active, even if this returns true.<br/>
|
||||
* Use {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}} if you want to check if the Node is actually treated as active in the scene.
|
||||
* !#zh
|
||||
* 当前节点的自身激活状态。<br/>
|
||||
* 值得注意的是,一个节点的父节点如果不被激活,那么即使它自身设为激活,它仍然无法激活。<br/>
|
||||
* 如果你想检查节点在场景中实际的激活状态可以使用 {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}}。
|
||||
* @property active
|
||||
* @type {Boolean}
|
||||
* @default true
|
||||
* @example
|
||||
* node.active = false;
|
||||
*/
|
||||
active: {
|
||||
get: function () {
|
||||
@@ -349,9 +361,12 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Indicates whether this node is active in the scene.
|
||||
* !#en Indicates whether this node is active in the scene.
|
||||
* !#zh 表示此节点是否在场景中激活。
|
||||
* @property activeInHierarchy
|
||||
* @type {Boolean}
|
||||
* @example
|
||||
* cc.log("activeInHierarchy: " + node.activeInHierarchy);
|
||||
*/
|
||||
activeInHierarchy: {
|
||||
get: function () {
|
||||
@@ -523,12 +538,20 @@ var Node = cc.Class({
|
||||
// COMPONENT
|
||||
|
||||
/**
|
||||
* Returns the component of supplied type if the node has one attached, null if it doesn't.
|
||||
* !#en
|
||||
* Returns the component of supplied type if the node has one attached, null if it doesn't.<br/>
|
||||
* You can also get component in the node by passing in the name of the script.
|
||||
*
|
||||
* !#zh
|
||||
* 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。<br/>
|
||||
* 传入参数也可以是脚本的名称。
|
||||
* @method getComponent
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component}
|
||||
* @example
|
||||
* // get sprite component.
|
||||
* var sprite = node.getComponent(cc.Sprite);
|
||||
* // get custom test calss.
|
||||
* var test = node.getComponent("Test");
|
||||
*/
|
||||
getComponent: function (typeOrClassName) {
|
||||
var constructor = getConstructor(typeOrClassName);
|
||||
@@ -539,11 +562,14 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns all components of supplied Type in the node.
|
||||
*
|
||||
* !#en Returns all components of supplied type in the node.
|
||||
* !#zh 返回节点上指定类型的所有组件。
|
||||
* @method getComponents
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component[]}
|
||||
* @example
|
||||
* var sprites = node.getComponents(cc.Sprite);
|
||||
* var tests = node.getComponents("Test");
|
||||
*/
|
||||
getComponents: function (typeOrClassName) {
|
||||
var constructor = getConstructor(typeOrClassName), components = [];
|
||||
@@ -555,11 +581,14 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the component of supplied type in any of its children using depth first search.
|
||||
*
|
||||
* !#en Returns the component of supplied type in any of its children using depth first search.
|
||||
* !#zh 递归查找所有子节点中第一个匹配指定类型的组件。
|
||||
* @method getComponentInChildren
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component}
|
||||
* @example
|
||||
* var sprite = node.getComponentInChildren(cc.Sprite);
|
||||
* var Test = node.getComponentInChildren("Test");
|
||||
*/
|
||||
getComponentInChildren: function (typeOrClassName) {
|
||||
var constructor = getConstructor(typeOrClassName);
|
||||
@@ -571,11 +600,14 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the components of supplied type in any of its children using depth first search.
|
||||
*
|
||||
* !#en Returns all components of supplied type in any of its children.
|
||||
* !#zh 递归查找所有子节点中指定类型的组件。
|
||||
* @method getComponentsInChildren
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component[]}
|
||||
* @example
|
||||
* var sprites = node.getComponentsInChildren(cc.Sprite);
|
||||
* var tests = node.getComponentsInChildren("Test");
|
||||
*/
|
||||
getComponentsInChildren: function (typeOrClassName) {
|
||||
var constructor = getConstructor(typeOrClassName), components = [];
|
||||
@@ -603,11 +635,14 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds a component class to the node. You can also add component to node by passing in the name of the script.
|
||||
*
|
||||
* !#en Adds a component class to the node. You can also add component to node by passing in the name of the script.
|
||||
* !#zh 向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。
|
||||
* @method addComponent
|
||||
* @param {Function|String} typeOrClassName - The constructor or the class name of the component to add
|
||||
* @returns {Component} - The newly added component
|
||||
* @example
|
||||
* var sprite = node.addComponent(cc.Sprite);
|
||||
* var test = node.addComponent("Test");
|
||||
*/
|
||||
addComponent: function (typeOrClassName) {
|
||||
|
||||
@@ -728,11 +763,19 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Removes a component identified by the given name or removes the component object given.
|
||||
* You can also use component.destroy() if you already have the reference.
|
||||
* !#zh
|
||||
* 删除节点上的指定组件,传入参数可以是一个组件构造函数或组件名,也可以是已经获得的组件引用。
|
||||
* 如果你已经获得组件引用,你也可以直接调用 component.destroy()
|
||||
* @method removeComponent
|
||||
* @param {String|Function|Component} component - The need remove component.
|
||||
* @deprecated please destroy the component to remove it.
|
||||
* @example
|
||||
* node.removeComponent(cc.Sprite);
|
||||
* var Test = require("Test");
|
||||
* node.removeComponent(Test);
|
||||
*/
|
||||
removeComponent: function (component) {
|
||||
if ( !component ) {
|
||||
@@ -973,12 +1016,16 @@ var Node = cc.Class({
|
||||
|
||||
// EVENTS
|
||||
/**
|
||||
* Register an callback of a specific event type on Node.
|
||||
* !#en
|
||||
* Register a callback of a specific event type on Node.<br/>
|
||||
* Use this method to register touch or mouse event permit propagation based on scene graph,
|
||||
* you can propagate the event to the parents or swallow it by calling stopPropagation on the event.
|
||||
* you can propagate the event to the parents or swallow it by calling stopPropagation on the event.<br/>
|
||||
* It's the recommended way to register touch/mouse event for Node,
|
||||
* please do not use cc.eventManager directly for Node.
|
||||
*
|
||||
* !#zh
|
||||
* 在节点上注册指定类型的回调函数,也可以设置 target 用于绑定响应函数的调用者。<br/>
|
||||
* 同时您可以将事件派发到父节点或者通过调用 stopPropagation 拦截它。<br/>
|
||||
* 推荐使用这种方式来监听节点上的触摸或鼠标事件,请不要在节点上直接使用 cc.eventManager。
|
||||
* @method on
|
||||
* @param {String} type - A string representing the event type to listen for.
|
||||
* @param {Function} callback - The callback that will be invoked when the event is dispatched.
|
||||
@@ -986,6 +1033,12 @@ var Node = cc.Class({
|
||||
* @param {Event} callback.param event
|
||||
* @param {Object} [target] - The target to invoke the callback, can be null
|
||||
* @return {Function} - Just returns the incoming callback so you can save the anonymous function easier.
|
||||
* @example
|
||||
* // add Node Touch Event
|
||||
* node.on(cc.Node.EventType.TOUCH_START, callback, this.node);
|
||||
* node.on(cc.Node.EventType.TOUCH_MOVE, callback, this.node);
|
||||
* node.on(cc.Node.EventType.TOUCH_END, callback, this.node);
|
||||
* node.on(cc.Node.EventType.TOUCH_END, callback, this.node);
|
||||
*/
|
||||
on: function (type, callback, target) {
|
||||
if (_touchEvents.indexOf(type) !== -1) {
|
||||
@@ -1023,13 +1076,18 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Removes the callback previously registered with the same type, callback, target and or useCapture.
|
||||
* This method is merely an alias to removeEventListener.
|
||||
*
|
||||
* !#zh 删除之前与同类型,回调,目标或 useCapture 注册的回调。
|
||||
* @method off
|
||||
* @param {String} type - A string representing the event type being removed.
|
||||
* @param {Function} callback - The callback to remove.
|
||||
* @param {Object} [target] - The target to invoke the callback, if it's not given, only callback without target will be removed
|
||||
* @example
|
||||
* // remove Node TOUCH_START Event.
|
||||
* node.on(cc.Node.EventType.TOUCH_START, callback, this.node);
|
||||
* node.off(cc.Node.EventType.TOUCH_START, callback, this.node);
|
||||
*/
|
||||
off: function (type, callback, target) {
|
||||
EventTarget.prototype.off.call(this, type, callback, target);
|
||||
@@ -1043,10 +1101,12 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes all callbacks previously registered with the same target.
|
||||
*
|
||||
* !#en Removes all callbacks previously registered with the same target.
|
||||
* !#zh 移除目标上的所有注册事件。
|
||||
* @method targetOff
|
||||
* @param {Object} target - The target to be searched for all related callbacks
|
||||
* @example
|
||||
* node.targetOff(target);
|
||||
*/
|
||||
targetOff: function (target) {
|
||||
EventTarget.prototype.targetOff.call(this, target);
|
||||
@@ -1131,12 +1191,19 @@ var Node = cc.Class({
|
||||
|
||||
// ACTIONS
|
||||
/**
|
||||
* !#en
|
||||
* Executes an action, and returns the action that is executed.<br/>
|
||||
* The node becomes the action's target. Refer to cc.Action's getTarget()
|
||||
* Calling runAction while the node is not active won't have any effect
|
||||
* The node becomes the action's target. Refer to cc.Action's getTarget()<br/>
|
||||
* Calling runAction while the node is not active won't have any effect.
|
||||
* !#zh
|
||||
* 执行并返回该执行的动作。该节点将会变成动作的目标。<br/>
|
||||
* 调用 runAction 时,节点自身处于不激活状态将不会有任何效果。
|
||||
* @method runAction
|
||||
* @param {Action} action
|
||||
* @return {Action} An Action pointer
|
||||
* @example
|
||||
* var action = cc.scaleTo(0.2, 1, 0.6);
|
||||
* node.runAction(action);
|
||||
*/
|
||||
runAction: function (action) {
|
||||
if (!this.active)
|
||||
@@ -1152,26 +1219,36 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops and removes all actions from the running action list .
|
||||
* !#en Stops and removes all actions from the running action list .
|
||||
* !#zh 停止并且移除所有正在运行的动作列表。
|
||||
* @method stopAllActions
|
||||
* @example
|
||||
* node.stopAllActions();
|
||||
*/
|
||||
stopAllActions: function () {
|
||||
cc.director.getActionManager().removeAllActionsFromTarget(this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops and removes an action from the running action list.
|
||||
* !#en Stops and removes an action from the running action list.
|
||||
* !#zh 停止并移除指定的动作。
|
||||
* @method stopAction
|
||||
* @param {Action} action An action object to be removed.
|
||||
* @example
|
||||
* var action = cc.scaleTo(0.2, 1, 0.6);
|
||||
* node.stopAction(action);
|
||||
*/
|
||||
stopAction: function (action) {
|
||||
cc.director.getActionManager().removeAction(action);
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes an action from the running action list by its tag.
|
||||
* !#en Removes an action from the running action list by its tag.
|
||||
* !#zh 停止并且移除指定标签的动作。
|
||||
* @method stopActionByTag
|
||||
* @param {Number} tag A tag that indicates the action to be removed.
|
||||
* @example
|
||||
* node.stopAction(1);
|
||||
*/
|
||||
stopActionByTag: function (tag) {
|
||||
if (tag === cc.Action.TAG_INVALID) {
|
||||
@@ -1182,11 +1259,14 @@ var Node = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an action from the running action list by its tag.
|
||||
* !#en Returns an action from the running action list by its tag.
|
||||
* !#zh 通过标签获取指定动作。
|
||||
* @method getActionByTag
|
||||
* @see cc.Action#getTag and cc.Action#setTag
|
||||
* @param {Number} tag
|
||||
* @return {Action} The action object with the given tag.
|
||||
* @example
|
||||
* var action = node.getActionByTag(1);
|
||||
*/
|
||||
getActionByTag: function (tag) {
|
||||
if (tag === cc.Action.TAG_INVALID) {
|
||||
@@ -1196,12 +1276,23 @@ var Node = cc.Class({
|
||||
cc.director.getActionManager().getActionByTag(tag, this);
|
||||
},
|
||||
|
||||
/** <p>Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).<br/>
|
||||
/**
|
||||
* !#en
|
||||
* Returns the numbers of actions that are running plus the ones that are schedule to run (actions in actionsToAdd and actions arrays).<br/>
|
||||
* Composable actions are counted as 1 action. Example:<br/>
|
||||
* If you are running 1 Sequence of 7 actions, it will return 1. <br/>
|
||||
* If you are running 7 Sequences of 2 actions, it will return 7.</p>
|
||||
* !#zh
|
||||
* 获取运行着的动作加上正在调度运行的动作的总数。<br/>
|
||||
* 例如:<br/>
|
||||
* - 如果你正在运行 7 个动作中的 1 个 Sequence,它将返回 1。<br/>
|
||||
* - 如果你正在运行 2 个动作中的 7 个 Sequence,它将返回 7。<br/>
|
||||
*
|
||||
* @method getNumberOfRunningActions
|
||||
* @return {Number} The number of actions that are running plus the ones that are schedule to run
|
||||
* @example
|
||||
* var count = node.getNumberOfRunningActions();
|
||||
* cc.log("Running Action Count: " + count);
|
||||
*/
|
||||
getNumberOfRunningActions: function () {
|
||||
cc.director.getActionManager().numberOfRunningActionsInTarget(this);
|
||||
@@ -1252,6 +1343,7 @@ if (cc.sys.isNative) {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @event position-changed
|
||||
* @param {Event} event
|
||||
* @param {Vec2} event.detail - old position
|
||||
@@ -1301,8 +1393,11 @@ if (cc.sys.isNative) {
|
||||
* @param {Event} event
|
||||
*/
|
||||
/**
|
||||
* !#en
|
||||
* Note: This event is only emitted from the top most node whose active value did changed,
|
||||
* not including its child nodes.
|
||||
* !#zh
|
||||
* 注意:此节点激活时,此事件仅从最顶部的节点发出。
|
||||
* @event active-in-hierarchy-changed
|
||||
* @param {Event} event
|
||||
*/
|
||||
|
||||
+18
-40
@@ -198,44 +198,6 @@ var TimerTargetSelector = Timer.extend({
|
||||
|
||||
});
|
||||
|
||||
var TimerTargetCallback = Timer.extend({
|
||||
|
||||
ctor: function(){
|
||||
this._target = null;
|
||||
this._callback = null;
|
||||
this._key = null;
|
||||
},
|
||||
|
||||
initWithCallback: function(scheduler, callback, target, key, seconds, repeat, delay){
|
||||
this._scheduler = scheduler;
|
||||
this._target = target;
|
||||
this._callback = callback;
|
||||
this._key = key;
|
||||
this.setupTimerWithInterval(seconds, repeat, delay);
|
||||
return true;
|
||||
},
|
||||
|
||||
getCallback: function(){
|
||||
return this._callback;
|
||||
},
|
||||
|
||||
getKey: function(){
|
||||
return this._key;
|
||||
},
|
||||
|
||||
trigger: function(){
|
||||
//override
|
||||
if(this._callback)
|
||||
this._callback.call(this._target, this._elapsed);
|
||||
},
|
||||
|
||||
cancel: function(){
|
||||
//override
|
||||
this._scheduler.unschedule(this._callback, this._target);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
var getTargetId = function (target) {
|
||||
return target.__instanceId || target.uuid;
|
||||
};
|
||||
@@ -575,6 +537,14 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
element.timers.push(timer);
|
||||
},
|
||||
|
||||
/**
|
||||
* Schedules the update callback for a given target, the callback will be invoked every frame after schedule started
|
||||
* @method scheduleUpdate
|
||||
* @param {Object} target
|
||||
* @param {Number} priority
|
||||
* @param {Boolean} paused
|
||||
* @param {Function} updateFunc
|
||||
*/
|
||||
scheduleUpdate: function(target, priority, paused, updateFunc){
|
||||
updateFunc = updateFunc || target.update;
|
||||
this._schedulePerFrame(updateFunc, target, priority, paused);
|
||||
@@ -591,8 +561,10 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
}
|
||||
},
|
||||
|
||||
/** Unschedules a callback for a callback and a given target.
|
||||
/**
|
||||
* Unschedules a callback for a callback and a given target.
|
||||
* If you want to unschedule the "update", use `unscheudleUpdate()`
|
||||
* @method unschedule
|
||||
* @param {Function} callback The callback to be unscheduled
|
||||
* @param {Object} target The target bound to the callback.
|
||||
*/
|
||||
@@ -635,6 +607,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
|
||||
/**
|
||||
* Unschedules the update callback for a given target
|
||||
* @method unscheduleUpdate
|
||||
* @param {Object} target The target to be unscheduled.
|
||||
*/
|
||||
unscheduleUpdate: function(target){
|
||||
@@ -655,6 +628,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
/**
|
||||
* Unschedules all scheduled callbacks for a given target.
|
||||
* This also includes the "update" callback.
|
||||
* @method unscheduleAllForTarget
|
||||
* @param {Object} target The target to be unscheduled.
|
||||
*/
|
||||
unscheduleAllForTarget: function(target){
|
||||
@@ -688,6 +662,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
/**
|
||||
* Unschedules all scheduled callbacks from all targets including the system callbacks.
|
||||
* You should NEVER call this method, unless you know what you are doing.
|
||||
* @method unscheduleAll
|
||||
*/
|
||||
unscheduleAll: function(){
|
||||
this.unscheduleAllWithMinPriority(cc.Scheduler.PRIORITY_SYSTEM);
|
||||
@@ -696,6 +671,7 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
/**
|
||||
* Unschedules all callbacks from all targets with a minimum priority.
|
||||
* You should only call this with `PRIORITY_NON_SYSTEM_MIN` or higher.
|
||||
* @method unscheduleAllWithMinPriority
|
||||
* @param {Number} minPriority The minimum priority of selector to be unscheduled. Which means, all selectors which
|
||||
* priority is higher than minPriority will be unscheduled.
|
||||
*/
|
||||
@@ -742,7 +718,9 @@ cc.Scheduler = cc._Class.extend(/** @lends cc.Scheduler# */{
|
||||
}
|
||||
},
|
||||
|
||||
/** Checks whether a callback for a given target is scheduled.
|
||||
/**
|
||||
* Checks whether a callback for a given target is scheduled.
|
||||
* @method isScheduled
|
||||
* @param {Function|String} key The callback to check.
|
||||
* @param {Object} target The target of the callback.
|
||||
* @return {Boolean} True if the specified callback is invoked, false if not.
|
||||
|
||||
@@ -25,12 +25,20 @@
|
||||
|
||||
var RawAsset = require('./CCRawAsset');
|
||||
/**
|
||||
* !#en
|
||||
* Base class for handling assets used in Fireball. This class can be instantiate.
|
||||
*
|
||||
* You may want to override:
|
||||
* - createNode
|
||||
* - cc.Object._serialize
|
||||
* - cc.Object._deserialize
|
||||
* You may want to override:<br/>
|
||||
* - createNode<br/>
|
||||
* - cc.Object._serialize<br/>
|
||||
* - cc.Object._deserialize<br/>
|
||||
* !#zh
|
||||
* 资源基类,该类可以被实例化。<br/>
|
||||
*
|
||||
* 您可能需要重写:<br/>
|
||||
* - createNode <br/>
|
||||
* - cc.Object._serialize<br/>
|
||||
* - cc.Object._deserialize<br/>
|
||||
*
|
||||
* @class Asset
|
||||
* @extends RawAsset
|
||||
@@ -41,9 +49,10 @@ cc.Asset = cc.Class({
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* !#en
|
||||
* Returns the url of this asset's first raw file, if none of rawFile exists,
|
||||
* it will returns an empty string.
|
||||
*
|
||||
* !#zh 返回该资源的原始文件的 URL,如果不支持 RAW 文件,它将返回一个空字符串。
|
||||
* @property rawUrl
|
||||
* @type {String}
|
||||
* @readOnly
|
||||
@@ -64,9 +73,10 @@ cc.Asset = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Returns the url of this asset's raw files, if none of rawFile exists,
|
||||
* it will returns an empty array.
|
||||
*
|
||||
* !#zh 返回该资源的原文件的 URL 数组,如果不支持 RAW 文件,它将返回一个空数组。
|
||||
* @property rawUrls
|
||||
* @type {String[]}
|
||||
* @readOnly
|
||||
@@ -129,9 +139,12 @@ cc.Asset = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Create a new node using this asset in the scene.
|
||||
* !#en
|
||||
* Create a new node using this asset in the scene.<br/>
|
||||
* If this type of asset dont have its corresponding node type, this method should be null.
|
||||
*
|
||||
* !#zh
|
||||
* 使用该资产在场景中创建一个新节点。<br/>
|
||||
* 如果这类资产没有相应的节点类型,该方法应该是空的。
|
||||
* @method createNode
|
||||
* @param {Function} callback
|
||||
* @param {String} callback.error - null or the error info
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Class for audio data handling.
|
||||
* !#en Class for audio data handling.
|
||||
* !#zh 音频资源类。
|
||||
* @class AudioClip
|
||||
* @extends RawAsset
|
||||
* @constructor
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
* @module cc
|
||||
*/
|
||||
/**
|
||||
* Class for BitmapFont handling.
|
||||
* !#en Class for BitmapFont handling.
|
||||
* !#zh 位图字体资源类。
|
||||
* @class BitmapFont
|
||||
* @extends RawAsset
|
||||
* @constructor
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
* @module cc
|
||||
*/
|
||||
/**
|
||||
* Class for Font handling.
|
||||
* !#en Class for Font handling.
|
||||
* !#zh 字体资源类。
|
||||
* @class Font
|
||||
* @extends RawAsset
|
||||
* @constructor
|
||||
|
||||
@@ -33,7 +33,8 @@ function visitWrapper (wrapper, visitor) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Class for prefab handling.
|
||||
* !#en Class for prefab handling.
|
||||
* !#zh 预制资源类。
|
||||
* @class Prefab
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
|
||||
@@ -25,10 +25,15 @@
|
||||
|
||||
var CCObject = require('../platform/CCObject');
|
||||
/**
|
||||
* !#en
|
||||
* The base class for registering asset types.
|
||||
*
|
||||
* You may want to override:
|
||||
* - createNode (static)
|
||||
* !#zh
|
||||
* 注册用的资源基类。<br/>
|
||||
* 你可能要重写:<br/>
|
||||
* - createNode (static)
|
||||
*
|
||||
* @class RawAsset
|
||||
* @extends CCObject
|
||||
@@ -52,9 +57,12 @@ cc.RawAsset = cc.Class({
|
||||
|
||||
statics: {
|
||||
/**
|
||||
* Create a new node in the scene.
|
||||
* !#en
|
||||
* Create a new node in the scene.<br/>
|
||||
* If this type of asset dont have its corresponding node type, this method should be null.
|
||||
*
|
||||
* !#zh
|
||||
* 在场景中创建一个新节点。<br/>
|
||||
* 如果这类资源没有相应的节点类型,该方法应该是空的。
|
||||
* @method createNodeByInfo
|
||||
* @param {Object} Info
|
||||
* @param {Function} callback
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Class for scene handling.
|
||||
* !#en Class for scene handling.
|
||||
* !#zh 场景资源类。
|
||||
* @class Scene
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Class for script handling.
|
||||
* !#en Class for script handling.
|
||||
* !#zh Script 资源类。
|
||||
* @class _Script
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
@@ -38,7 +39,8 @@ var Script = cc.Class({
|
||||
cc._Script = Script;
|
||||
|
||||
/**
|
||||
* Class for JavaScript handling.
|
||||
* !#en Class for JavaScript handling.
|
||||
* !#zh JavaScript 资源类。
|
||||
* @class _JavaScript
|
||||
* @extends Asset
|
||||
* @private
|
||||
@@ -52,7 +54,8 @@ var JavaScript = cc.Class({
|
||||
cc._JavaScript = JavaScript;
|
||||
|
||||
/**
|
||||
* Class for coffee script handling.
|
||||
* !#en Class for coffee script handling.
|
||||
* !#zh CoffeeScript 资源类。
|
||||
* @class CoffeeScript
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Class for sprite atlas handling.
|
||||
* !#en Class for sprite atlas handling.
|
||||
* !#zh 精灵图集资源类。
|
||||
* @class SpriteAtlas
|
||||
* @extends RawAsset
|
||||
* @constructor
|
||||
@@ -32,6 +33,37 @@
|
||||
var SpriteAtlas = cc.Class({
|
||||
name: 'cc.SpriteAtlas',
|
||||
extends: cc.Asset,
|
||||
properties: {
|
||||
_spriteFrames: {
|
||||
default: {}
|
||||
},
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the texture of the sprite atlas
|
||||
* @method getTexture
|
||||
* @returns {cc.Texture2D}
|
||||
*/
|
||||
getTexture: function () {
|
||||
var keys = Object.keys(this._spriteFrames);
|
||||
if (keys.length > 0) {
|
||||
var spriteFrame = this._spriteFrames[keys[0]];
|
||||
return spriteFrame ? spriteFrame.getTexture() : null;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the sprite frame correspond to the given key in sprite atlas.
|
||||
* @method getSpriteFrame
|
||||
* @param {String} key
|
||||
* @returns {cc.SpriteFrame}
|
||||
*/
|
||||
getSpriteFrame: function (key) {
|
||||
return this._spriteFrames[key];
|
||||
}
|
||||
});
|
||||
|
||||
cc.SpriteAtlas = SpriteAtlas;
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
* @module cc
|
||||
*/
|
||||
/**
|
||||
* Class for TTFFont handling.
|
||||
* !#en Class for TTFFont handling.
|
||||
* !#zh TTF 字体资源类。
|
||||
* @class TTFFont
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Class for text file.
|
||||
* !#en Class for text file.
|
||||
* !#zh 文本资源类。
|
||||
* @class TextAsset
|
||||
* @extends Asset
|
||||
* @constructor
|
||||
|
||||
@@ -375,7 +375,7 @@ _ccsg.Node.RenderCmd.prototype = {
|
||||
|
||||
if (transformDirty)
|
||||
//update the transform
|
||||
this.transform(parentCmd);
|
||||
this.transform(parentCmd, true);
|
||||
},
|
||||
|
||||
visitChildren: function(){
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
****************************************************************************/
|
||||
|
||||
/**
|
||||
* Audio Source.
|
||||
* !#en Audio Source.
|
||||
* !#zh 音频源组件,能对音频剪辑。
|
||||
* @class AudioSource
|
||||
* @extends Component
|
||||
*/
|
||||
@@ -54,7 +55,8 @@ var AudioSource = cc.Class({
|
||||
_loop: false,
|
||||
|
||||
/**
|
||||
* Is the audio source playing (Read Only)
|
||||
* !#en Is the audio source playing (Read Only).
|
||||
* !#zh 该音频剪辑是否正播放(只读)。
|
||||
* @property isPlaying
|
||||
* @type {Boolean}
|
||||
* @readOnly
|
||||
@@ -68,7 +70,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* The clip of the audio source.
|
||||
* !#en The clip of the audio source.
|
||||
* !#zh 默认要播放的音频剪辑。
|
||||
* @property clip
|
||||
* @type {AudioClip}
|
||||
* @default 1
|
||||
@@ -86,7 +89,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* The volume of the audio source.
|
||||
* !#en The volume of the audio source.
|
||||
* !#zh 音频源的音量(0.0 ~ 1.0)。
|
||||
* @property volume
|
||||
* @type {Number}
|
||||
* @default 1
|
||||
@@ -110,7 +114,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Is the audio source mute?
|
||||
* !#en Is the audio source mute?
|
||||
* !#zh 是否静音音频源。Mute 是设置音量为 0,取消静音是恢复原来的音量。
|
||||
* @property mute
|
||||
* @type {Boolean}
|
||||
* @default false
|
||||
@@ -145,7 +150,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Is the audio source looping?
|
||||
* !#en Is the audio source looping?
|
||||
* !#zh 音频源是否循环播放?
|
||||
* @property loop
|
||||
* @type {Boolean}
|
||||
* @default false
|
||||
@@ -163,7 +169,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* If set to true, the audio source will automatically start playing on onLoad.
|
||||
* !#en If set to true, the audio source will automatically start playing on onLoad.
|
||||
* !#zh 如果设置为true,音频源将在 onLoad 时自动播放。
|
||||
* @property playOnLoad
|
||||
* @type {Boolean}
|
||||
* @default true
|
||||
@@ -196,7 +203,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Plays the clip.
|
||||
* !#en Plays the clip.
|
||||
* !#zh 播放音频剪辑。
|
||||
* @method play
|
||||
*/
|
||||
play: function () {
|
||||
@@ -207,7 +215,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Stops the clip
|
||||
* !#en Stops the clip.
|
||||
* !#zh 停止当前音频剪辑。
|
||||
* @method stop
|
||||
*/
|
||||
stop: function () {
|
||||
@@ -215,7 +224,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Pause the clip.
|
||||
* !#en Pause the clip.
|
||||
* !#zh 暂停当前音频剪辑。
|
||||
* @method pause
|
||||
*/
|
||||
pause: function () {
|
||||
@@ -223,7 +233,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Resume the clip.
|
||||
* !#en Resume the clip.
|
||||
* !#zh 恢复播放。
|
||||
* @method resume
|
||||
*/
|
||||
resume: function () {
|
||||
@@ -231,7 +242,8 @@ var AudioSource = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Rewind playing music.
|
||||
* !#en Rewind playing music.
|
||||
* !#zh 从头开始播放。
|
||||
* @method rewind
|
||||
*/
|
||||
rewind: function(){
|
||||
|
||||
@@ -181,10 +181,15 @@ var _callLateUpdate = CC_EDITOR ? function (event) {
|
||||
var idGenerater = new IdGenerater('Comp');
|
||||
|
||||
/**
|
||||
* Base class for everything attached to Node(Entity).
|
||||
*
|
||||
* !#en
|
||||
* Base class for everything attached to Node(Entity).<br/>
|
||||
* <br/>
|
||||
* NOTE: Not allowed to use construction parameters for Component's subclasses,
|
||||
* because Component is created by the engine.
|
||||
* !#zh
|
||||
* 所有附加到节点的基类。<br/>
|
||||
* <br/>
|
||||
* 注意:不允许使用组件的子类构造参数,因为组件是由引擎创建的。
|
||||
*
|
||||
* @class Component
|
||||
* @extends Object
|
||||
@@ -211,9 +216,12 @@ var Component = cc.Class({
|
||||
|
||||
properties: {
|
||||
/**
|
||||
* The node this component is attached to. A component is always attached to a node.
|
||||
* !#en The node this component is attached to. A component is always attached to a node.
|
||||
* !#zh 该组件被附加到的节点。组件总会附加到一个节点。
|
||||
* @property node
|
||||
* @type {Node}
|
||||
* @example
|
||||
* cc.log(comp.node);
|
||||
*/
|
||||
node: {
|
||||
default: null,
|
||||
@@ -243,10 +251,13 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* The uuid for editor
|
||||
* !#en The uuid for editor.
|
||||
* !#zh 组件的 uuid,用于编辑器。
|
||||
* @property uuid
|
||||
* @type {String}
|
||||
* @readOnly
|
||||
* @example
|
||||
* cc.log(comp.uuid);
|
||||
*/
|
||||
uuid: {
|
||||
get: function () {
|
||||
@@ -295,10 +306,14 @@ var Component = cc.Class({
|
||||
_enabled: true,
|
||||
|
||||
/**
|
||||
* indicates whether this component is enabled or not.
|
||||
* !#en indicates whether this component is enabled or not.
|
||||
* !#zh 表示该组件自身是否启用。
|
||||
* @property enabled
|
||||
* @type {Boolean}
|
||||
* @default true
|
||||
* @example
|
||||
* comp.enabled = true;
|
||||
* cc.log(comp.enabled);
|
||||
*/
|
||||
enabled: {
|
||||
get: function () {
|
||||
@@ -316,10 +331,13 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* indicates whether this component is enabled and its node is also active in the hierarchy.
|
||||
* !#en indicates whether this component is enabled and its node is also active in the hierarchy.
|
||||
* !#zh 表示该组件是否被启用并且所在的节点也处于激活状态。。
|
||||
* @property enabledInHierarchy
|
||||
* @type {Boolean}
|
||||
* @readOnly
|
||||
* @example
|
||||
* cc.log(comp.enabledInHierarchy);
|
||||
*/
|
||||
enabledInHierarchy: {
|
||||
get: function () {
|
||||
@@ -329,9 +347,13 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* !#en TODO
|
||||
* !#zh onLoad 是否被调用。
|
||||
* @property _isOnLoadCalled
|
||||
* @type {Boolean}
|
||||
* @readOnly
|
||||
* @example
|
||||
* cc.log(_isOnLoadCalled);
|
||||
*/
|
||||
_isOnLoadCalled: {
|
||||
get: function () {
|
||||
@@ -358,43 +380,50 @@ var Component = cc.Class({
|
||||
// We provide Pre methods, which are called right before something happens, and Post methods which are called right after something happens.
|
||||
|
||||
/**
|
||||
* Update is called every frame, if the Component is enabled.
|
||||
* !#en Update is called every frame, if the Component is enabled.
|
||||
* !#zh 如果该组件启用,则每帧调用 update。
|
||||
* @method update
|
||||
*/
|
||||
update: null,
|
||||
|
||||
/**
|
||||
* LateUpdate is called every frame, if the Component is enabled.
|
||||
* !#en LateUpdate is called every frame, if the Component is enabled.
|
||||
* !#zh 如果该组件启用,则每帧调用 LateUpdate。
|
||||
* @method lateUpdate
|
||||
*/
|
||||
lateUpdate: null,
|
||||
|
||||
/**
|
||||
* When attaching to an active node or its node first activated
|
||||
* !#en When attaching to an active node or its node first activated.
|
||||
* !#zh 当附加到一个激活的节点上或者其节点第一次激活时候调用。
|
||||
* @method onLoad
|
||||
*/
|
||||
onLoad: null,
|
||||
|
||||
/**
|
||||
* Called before all scripts' update if the Component is enabled
|
||||
* !#en Called before all scripts' update if the Component is enabled.
|
||||
* !#zh 如果该组件启用,则在所有组件的 update 之前调用。
|
||||
* @method start
|
||||
*/
|
||||
start: null,
|
||||
|
||||
/**
|
||||
* Called when this component becomes enabled and its node becomes active
|
||||
* !#en Called when this component becomes enabled and its node is active.
|
||||
* !#zh 当该组件被启用,并且它的节点也激活时。
|
||||
* @method onEnable
|
||||
*/
|
||||
onEnable: null,
|
||||
|
||||
/**
|
||||
* Called when this component becomes disabled or its node becomes inactive
|
||||
* !#en Called when this component becomes disabled or its node becomes inactive.
|
||||
* !#zh 当该组件被禁用或节点变为无效时调用。
|
||||
* @method onDisable
|
||||
*/
|
||||
onDisable: null,
|
||||
|
||||
/**
|
||||
* Called when this component will be destroyed.
|
||||
* !#en Called when this component will be destroyed.
|
||||
* !#zh 当该组件被销毁时调用
|
||||
* @method onDestroy
|
||||
*/
|
||||
onDestroy: null,
|
||||
@@ -411,57 +440,81 @@ var Component = cc.Class({
|
||||
// PUBLIC
|
||||
|
||||
/**
|
||||
* Adds a component class to the node. You can also add component to node by passing in the name of the
|
||||
* script.
|
||||
* !#en Adds a component class to the node. You can also add component to node by passing in the name of the script.
|
||||
* !#zh 向节点添加一个组件类,你还可以通过传入脚本的名称来添加组件。
|
||||
*
|
||||
* @method addComponent
|
||||
* @param {Function|String} typeOrTypename - the constructor or the class name of the component to add
|
||||
* @return {Component} - the newly added component
|
||||
* @example
|
||||
* var sprite = node.addComponent(cc.Sprite);
|
||||
* var test = node.addComponent("Test");
|
||||
*/
|
||||
addComponent: function (typeOrTypename) {
|
||||
return this.node.addComponent(typeOrTypename);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the component of supplied type if the node has one attached, null if it doesn't. You can also get
|
||||
* component in the node by passing in the name of the script.
|
||||
* !#en
|
||||
* Returns the component of supplied type if the node has one attached, null if it doesn't.<br/>
|
||||
* You can also get component in the node by passing in the name of the script.
|
||||
* !#zh
|
||||
* 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。<br/>
|
||||
* 传入参数也可以是脚本的名称。
|
||||
*
|
||||
* @method getComponent
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @return {Component}
|
||||
* @example
|
||||
* // get sprite component.
|
||||
* var sprite = node.getComponent(cc.Sprite);
|
||||
* // get custom test calss.
|
||||
* var test = node.getComponent("Test");
|
||||
*/
|
||||
getComponent: function (typeOrClassName) {
|
||||
return this.node.getComponent(typeOrClassName);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns all components of supplied Type in the node.
|
||||
* !#en Returns all components of supplied Type in the node.
|
||||
* !#zh 返回节点上指定类型的所有组件。
|
||||
*
|
||||
* @method getComponents
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @return {Component[]}
|
||||
* @example
|
||||
* var sprites = node.getComponents(cc.Sprite);
|
||||
* var tests = node.getComponents("Test");
|
||||
*/
|
||||
getComponents: function (typeOrClassName) {
|
||||
return this.node.getComponents(typeOrClassName);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the component of supplied type in any of its children using depth first search.
|
||||
* !#en Returns the component of supplied type in any of its children using depth first search.
|
||||
* !#zh 递归查找所有子节点中第一个匹配指定类型的组件。
|
||||
*
|
||||
* @method getComponentInChildren
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component}
|
||||
* @example
|
||||
* var sprite = node.getComponentInChildren(cc.Sprite);
|
||||
* var Test = node.getComponentInChildren("Test");
|
||||
*/
|
||||
getComponentInChildren: function (typeOrClassName) {
|
||||
return this.node.getComponentInChildren(typeOrClassName);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the components of supplied type in any of its children using depth first search.
|
||||
* !#en Returns the components of supplied type in any of its children using depth first search.
|
||||
* !#zh 递归查找所有子节点中指定类型的组件。
|
||||
*
|
||||
* @method getComponentsInChildren
|
||||
* @param {Function|String} typeOrClassName
|
||||
* @returns {Component[]}
|
||||
* @example
|
||||
* var sprites = node.getComponentsInChildren(cc.Sprite);
|
||||
* var tests = node.getComponentsInChildren("Test");
|
||||
*/
|
||||
getComponentsInChildren: function (typeOrClassName) {
|
||||
return this.node.getComponentsInChildren(typeOrClassName);
|
||||
@@ -539,8 +592,12 @@ var Component = cc.Class({
|
||||
// VIRTUAL
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* If the component's bounding box is different from the node's, you can implement this method to supply
|
||||
* a custom axis aligned bounding box (AABB), so the editor's scene view can perform hit test properly.
|
||||
* !#zh
|
||||
* 如果组件的包围盒与节点不同,您可以实现该方法以提供自定义的轴向对齐的包围盒(AABB),
|
||||
* 以便编辑器的场景视图可以正确地执行点选测试。
|
||||
*
|
||||
* @method _getLocalBounds
|
||||
* @param {Rect} out_rect - the Rect to receive the bounding box
|
||||
@@ -548,27 +605,44 @@ var Component = cc.Class({
|
||||
_getLocalBounds: null,
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* onRestore is called after the user clicks the Reset item in the Inspector's context menu or performs
|
||||
* an undo operation on this component.
|
||||
*
|
||||
* If the component contains the "internal state", short for "temporary member variables which not included
|
||||
* in its CCClass properties", then you may need to implement this function.
|
||||
*
|
||||
* The editor will call the getset accessors of your component to record/restore the component's state
|
||||
* for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement
|
||||
* this function to manually synchronize your component's "internal states" with its public properties.
|
||||
* Once you implement this function, all the getset accessors of your component will not be called when
|
||||
* the user performs an undo/redo operation. Which means that only the properties with default value
|
||||
* will be recorded or restored by editor.
|
||||
*
|
||||
* Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need
|
||||
* to support the reset menu, you should manually synchronize your component's "internal states" with its
|
||||
* properties in this function. Once you implement this function, all the getset accessors of your component
|
||||
* will not be called during reset operation. Which means that only the properties with default value
|
||||
* an undo operation on this component.<br/>
|
||||
* <br/>
|
||||
* If the component contains the "internal state", short for "temporary member variables which not included<br/>
|
||||
* in its CCClass properties", then you may need to implement this function.<br/>
|
||||
* <br/>
|
||||
* The editor will call the getset accessors of your component to record/restore the component's state<br/>
|
||||
* for undo/redo operation. However, in extreme cases, it may not works well. Then you should implement<br/>
|
||||
* this function to manually synchronize your component's "internal states" with its public properties.<br/>
|
||||
* Once you implement this function, all the getset accessors of your component will not be called when<br/>
|
||||
* the user performs an undo/redo operation. Which means that only the properties with default value<br/>
|
||||
* will be recorded or restored by editor.<br/>
|
||||
* <br/>
|
||||
* Similarly, the editor may failed to reset your component correctly in extreme cases. Then if you need<br/>
|
||||
* to support the reset menu, you should manually synchronize your component's "internal states" with its<br/>
|
||||
* properties in this function. Once you implement this function, all the getset accessors of your component<br/>
|
||||
* will not be called during reset operation. Which means that only the properties with default value<br/>
|
||||
* will be reset by editor.
|
||||
*
|
||||
* This function is only called in editor mode.
|
||||
*
|
||||
* !#zh
|
||||
* onRestore 是用户在检查器菜单点击 Reset 时,对此组件执行撤消操作后调用的。<br/>
|
||||
* <br/>
|
||||
* 如果组件包含了“内部状态”(不在 CCClass 属性中定义的临时成员变量),那么你可能需要实现该方法。<br/>
|
||||
* <br/>
|
||||
* 编辑器执行撤销/重做操作时,将调用组件的 get set 来录制和还原组件的状态。
|
||||
* 然而,在极端的情况下,它可能无法良好运作。<br/>
|
||||
* 那么你就应该实现这个方法,手动根据组件的属性同步“内部状态”。
|
||||
* 一旦你实现这个方法,当用户撤销或重做时,组件的所有 get set 都不会再被调用。
|
||||
* 这意味着仅仅指定了默认值的属性将被编辑器记录和还原。<br/>
|
||||
* <br/>
|
||||
* 同样的,编辑可能无法在极端情况下正确地重置您的组件。<br/>
|
||||
* 于是如果你需要支持组件重置菜单,你需要在该方法中手工同步组件属性到“内部状态”。<br/>
|
||||
* 一旦你实现这个方法,组件的所有 get set 都不会在重置操作时被调用。
|
||||
* 这意味着仅仅指定了默认值的属性将被编辑器重置。
|
||||
* <br/>
|
||||
* 此方法仅在编辑器下会被调用。
|
||||
* @method onRestore
|
||||
*/
|
||||
onRestore: null,
|
||||
@@ -685,13 +759,20 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* <p>Schedules a custom selector. <br/>
|
||||
* If the selector is already scheduled, then the interval parameter will be updated without scheduling it again.</p>
|
||||
* !#en
|
||||
* Schedules a custom selector.<br/>
|
||||
* If the selector is already scheduled, then the interval parameter will be updated without scheduling it again.
|
||||
* !#zh
|
||||
* 调度一个自定义的回调函数。<br/>
|
||||
* 如果回调函数已调度,那么将不会重复调度它,只会更新时间间隔参数。
|
||||
* @method schedule
|
||||
* @param {function} callback The callback function
|
||||
* @param {Number} [interval=0] Tick interval in seconds. 0 means tick every frame. If interval = 0, it's recommended to use scheduleUpdate() instead.
|
||||
* @param {Number} [repeat=cc.macro.REPEAT_FOREVER] The selector will be executed (repeat + 1) times, you can use kCCRepeatForever for tick infinitely.
|
||||
* @param {Number} [delay=0] The amount of time that the first tick will wait before execution.
|
||||
* @example
|
||||
* var squashAction = cc.scaleTo(0.2, 1, 0.6);
|
||||
* this.seq = cc.sequence(squashAction);
|
||||
*/
|
||||
schedule: function (callback, interval, repeat, delay) {
|
||||
cc.assert(callback, cc._LogInfos.Node.schedule);
|
||||
@@ -705,21 +786,28 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* Schedules a callback function that runs only once, with a delay of 0 or larger
|
||||
* !#en Schedules a callback function that runs only once, with a delay of 0 or larger.
|
||||
* !#zh 调度一个只运行一次的回调函数,可以指定 0 让回调函数在下一帧立即执行或者在一定的延时之后执行。
|
||||
* @method scheduleOnce
|
||||
* @see cc.Node#schedule
|
||||
* @param {function} callback A function wrapped as a selector
|
||||
* @param {Number} [delay=0] The amount of time that the first tick will wait before execution.
|
||||
* @example
|
||||
* var squashAction = cc.scaleTo(0.2, 1, 0.6);
|
||||
* this.seq = cc.scheduleOnce(squashAction);
|
||||
*/
|
||||
scheduleOnce: function (callback, delay) {
|
||||
this.schedule(callback, 0, 0, delay);
|
||||
},
|
||||
|
||||
/**
|
||||
* Unschedules a custom callback function.
|
||||
* !#en Unschedules a custom callback function.
|
||||
* !#zh 取消调度一个自定义的回调函数。
|
||||
* @method unschedule
|
||||
* @see cc.Node#schedule
|
||||
* @param {function} callback_fn A function wrapped as a selector
|
||||
* @example
|
||||
* this.unschedule(_callback);
|
||||
*/
|
||||
unschedule: function (callback_fn) {
|
||||
if (!callback_fn)
|
||||
@@ -729,9 +817,13 @@ var Component = cc.Class({
|
||||
},
|
||||
|
||||
/**
|
||||
* <p>unschedule all scheduled callback functions: custom callback functions, and the 'update' callback function.<br/>
|
||||
* Actions are not affected by this method.</p>
|
||||
* !#en
|
||||
* unschedule all scheduled callback functions: custom callback functions, and the 'update' callback function.<br/>
|
||||
* Actions are not affected by this method.
|
||||
* !#zh 取消调度所有已调度的回调函数:定制的回调函数以及 'update' 回调函数。动作不受此方法影响。
|
||||
* @method unscheduleAllCallbacks
|
||||
* @example
|
||||
* this.unscheduleAllCallbacks();
|
||||
*/
|
||||
unscheduleAllCallbacks: function () {
|
||||
cc.director.getScheduler().unscheduleAllForTarget(this);
|
||||
|
||||
@@ -420,7 +420,10 @@ var EditBox = cc.Class({
|
||||
|
||||
this._createBackgroundSprite();
|
||||
|
||||
if (!this._useOriginalSize) {
|
||||
if(this._useOriginalSize && CC_EDITOR){
|
||||
this.node.setContentSize(sgNode.getContentSize());
|
||||
this._useOriginalSize = false;
|
||||
} else {
|
||||
sgNode.setContentSize(this.node.getContentSize());
|
||||
}
|
||||
|
||||
@@ -441,16 +444,6 @@ var EditBox = cc.Class({
|
||||
sgNode.setDelegate(this);
|
||||
},
|
||||
|
||||
_resized: function () {
|
||||
this._useOriginalSize = false;
|
||||
},
|
||||
|
||||
onLoad: function () {
|
||||
this._super();
|
||||
|
||||
this.node.on('size-changed', this._resized, this);
|
||||
},
|
||||
|
||||
editBoxEditingDidBegan: function() {
|
||||
cc.Component.EventHandler.emitEvents(this.editingDidBegan);
|
||||
},
|
||||
|
||||
@@ -293,8 +293,6 @@ var Label = cc.Class({
|
||||
onLoad: function () {
|
||||
this._super();
|
||||
|
||||
this.node.on('size-changed', this._resized, this);
|
||||
|
||||
var sgSizeInitialized = this._sgNode._isUseSystemFont;
|
||||
if (sgSizeInitialized) {
|
||||
this._updateNodeSize();
|
||||
@@ -310,11 +308,6 @@ var Label = cc.Class({
|
||||
}
|
||||
},
|
||||
|
||||
onDestroy: function () {
|
||||
this._super();
|
||||
this.node.off('size-changed', this._resized, this);
|
||||
},
|
||||
|
||||
_createSgNode: function () {
|
||||
return null;
|
||||
},
|
||||
@@ -335,18 +328,15 @@ var Label = cc.Class({
|
||||
sgNode.setLineHeight(this._lineHeight);
|
||||
sgNode.setString(this.string);
|
||||
sgNode.setFontFileOrFamily(this.file);
|
||||
if(!this._useOriginalSize){
|
||||
if(this.overflow !== Overflow.NONE) {
|
||||
sgNode.setContentSize(this.node.getContentSize());
|
||||
}
|
||||
if(this._useOriginalSize && CC_EDITOR){
|
||||
this.node.setContentSize(sgNode.getContentSize());
|
||||
this._useOriginalSize = false;
|
||||
} else {
|
||||
sgNode.setContentSize(this.node.getContentSize());
|
||||
}
|
||||
sgNode.setColor(this.node.color);
|
||||
},
|
||||
|
||||
_resized: function () {
|
||||
this._useOriginalSize = false;
|
||||
},
|
||||
|
||||
// update node size (this will also invoke the size-changed event)
|
||||
_updateNodeSize: function () {
|
||||
var initialized = this._sgNode && this._sgNode.parent;
|
||||
|
||||
@@ -259,6 +259,9 @@ var ProgressBar = cc.Class({
|
||||
default: false,
|
||||
tooltip: 'i18n:COMPONENT.progress.reverse',
|
||||
notify: function() {
|
||||
if (this.barSprite) {
|
||||
this.barSprite.fillStart = 1 - this.barSprite.fillStart;
|
||||
}
|
||||
this._updateBarStatus();
|
||||
},
|
||||
animatable: false
|
||||
|
||||
@@ -166,9 +166,6 @@ var Sprite = cc.Class({
|
||||
var lastSprite = this._spriteFrame;
|
||||
this._spriteFrame = value;
|
||||
this._applySpriteFrame(lastSprite);
|
||||
// color cleared after reset texture, should re-apply color
|
||||
this._sgNode.setColor(this.node._color);
|
||||
this._sgNode.setOpacity(this.node._opacity);
|
||||
},
|
||||
type: cc.SpriteFrame,
|
||||
},
|
||||
|
||||
@@ -250,9 +250,8 @@ EditBoxImpl.prototype = {
|
||||
},
|
||||
|
||||
_updateLabelPosition: function (editBoxSize) {
|
||||
var textLabelSize = this._textLabel.getContentSize();
|
||||
this._placeholderLabel.setLineHeight(editBoxSize.height);
|
||||
this._textLabel.setContentSize(editBoxSize);
|
||||
this._placeholderLabel.setLineHeight(editBoxSize.height);
|
||||
var placeholderLabelSize = this._placeholderLabel.getContentSize();
|
||||
|
||||
if (this._editBox._editBoxInputMode === InputMode.ANY){
|
||||
@@ -264,7 +263,7 @@ EditBoxImpl.prototype = {
|
||||
}
|
||||
else {
|
||||
this._textLabel.enableWrapText(false);
|
||||
this._textLabel.setPosition(cc.p(0, (editBoxSize.height + textLabelSize.height) / 2));
|
||||
this._textLabel.setPosition(cc.p(0, editBoxSize.height));
|
||||
this._placeholderLabel.setPosition(cc.p(0, (editBoxSize.height + placeholderLabelSize.height) / 2));
|
||||
this._placeholderLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER);
|
||||
this._textLabel.setVerticalAlign(cc.VerticalTextAlignment.CENTER);
|
||||
|
||||
@@ -175,7 +175,7 @@ JS.mixin(EventTarget.prototype, {
|
||||
* When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE.
|
||||
* Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET.
|
||||
* @return {Function} - Just returns the incoming callback so you can save the anonymous function easier.
|
||||
* @exmaple
|
||||
* @example
|
||||
* node.on(cc.Node.EventType.TOUCH_END, function (event) {
|
||||
* cc.log("this is callback");
|
||||
* }, node);
|
||||
@@ -222,7 +222,7 @@ JS.mixin(EventTarget.prototype, {
|
||||
* If not specified, useCapture defaults to false. If a callback was registered twice,
|
||||
* one with capture and one without, each must be removed separately. Removal of a capturing callback
|
||||
* does not affect a non-capturing version of the same listener, and vice versa.
|
||||
* @exmaple
|
||||
* @example
|
||||
* // register touchEnd eventListener
|
||||
* var touchEnd = node.on(cc.Node.EventType.TOUCH_END, function (event) {
|
||||
* cc.log("this is callback");
|
||||
@@ -283,7 +283,7 @@ JS.mixin(EventTarget.prototype, {
|
||||
* from being invoked when the event's eventPhase attribute value is BUBBLING_PHASE.
|
||||
* When false, callback will NOT be invoked when event's eventPhase attribute value is CAPTURING_PHASE.
|
||||
* Either way, callback will be invoked when event's eventPhase attribute value is AT_TARGET.
|
||||
* @exmaple
|
||||
* @example
|
||||
* node.once(cc.Node.EventType.TOUCH_END, function (event) {
|
||||
* cc.log("this is callback");
|
||||
* }, node);
|
||||
|
||||
@@ -126,8 +126,8 @@ function loadAudioFromExtList (url, typeList, audio, cb){
|
||||
if(__audioSupport.USE_EMPTIED_EVENT)
|
||||
element.addEventListener('emptied', emptied, false);
|
||||
|
||||
element.src = url;
|
||||
document.body.appendChild(element);
|
||||
element.src = url;
|
||||
element.volume = 0;
|
||||
//some browsers cannot pause(qq 6.1)
|
||||
//element.play();
|
||||
|
||||
@@ -65,13 +65,15 @@ CCObject.Flags = {
|
||||
//ToDestroy: ToDestroy,
|
||||
|
||||
/**
|
||||
* The object will not be saved.
|
||||
* !#en The object will not be saved.
|
||||
* !#zh 该对象将不会被保存。
|
||||
* @property {Number} DontSave
|
||||
*/
|
||||
DontSave: DontSave,
|
||||
|
||||
/**
|
||||
* The object will not be saved when building a player.
|
||||
* !#en The object will not be saved when building a player.
|
||||
* !#zh 构建项目时,该对象将不会被保存。
|
||||
* @property {Number} EditorOnly
|
||||
*/
|
||||
EditorOnly: EditorOnly,
|
||||
@@ -79,7 +81,8 @@ CCObject.Flags = {
|
||||
Dirty: Dirty,
|
||||
|
||||
/**
|
||||
* Dont destroy automatically when loading a new scene.
|
||||
* !#en Dont destroy automatically when loading a new scene.
|
||||
* !#zh 加载一个新场景时,不自动删除该对象
|
||||
* @property DontDestroy
|
||||
* @private
|
||||
*/
|
||||
@@ -92,8 +95,12 @@ CCObject.Flags = {
|
||||
Destroying: Destroying,
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Hide in game and hierarchy.
|
||||
* This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags()
|
||||
* This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags().
|
||||
* !#zh
|
||||
* 在游戏和层级中隐藏该对象。<br/>
|
||||
* 该标记只读,它只能被用作 scene.addEntity()的一个参数。
|
||||
* @property {Number} HideInGame
|
||||
*/
|
||||
HideInGame: HideInGame,
|
||||
@@ -101,14 +108,19 @@ CCObject.Flags = {
|
||||
// FLAGS FOR EDITOR
|
||||
|
||||
/**
|
||||
* This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags()
|
||||
* !#en This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags().
|
||||
* !#zh 该标记只读,它只能被用作 scene.addEntity()的一个参数。
|
||||
* @property {Number} HideInEditor
|
||||
*/
|
||||
HideInEditor: HideInEditor,
|
||||
|
||||
/**
|
||||
* !#en
|
||||
* Hide in game view, hierarchy, and scene view... etc.
|
||||
* This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags()
|
||||
* This flag is readonly, it can only be used as an argument of scene.addEntity() or Entity.createWithFlags().
|
||||
* !#zh
|
||||
* 在游戏视图,层级,场景视图等等...中隐藏该对象。
|
||||
* 该标记只读,它只能被用作 scene.addEntity()的一个参数。
|
||||
* @property {Number} Hide
|
||||
*/
|
||||
Hide: Hide,
|
||||
@@ -184,9 +196,12 @@ if (CC_EDITOR) {
|
||||
var prototype = CCObject.prototype;
|
||||
|
||||
/**
|
||||
* The name of the object.
|
||||
* !#en The name of the object.
|
||||
* !#zh 该对象的名称。
|
||||
* @property {String} name
|
||||
* @default ""
|
||||
* @example
|
||||
* obj.name = "New Obj";
|
||||
*/
|
||||
JS.getset(prototype, 'name',
|
||||
function () {
|
||||
@@ -198,10 +213,13 @@ JS.getset(prototype, 'name',
|
||||
);
|
||||
|
||||
/**
|
||||
* Indicates whether the object is not yet destroyed
|
||||
* !#en Indicates whether the object is not yet destroyed.
|
||||
* !#zh 表示该对象是否可用(被销毁后将不可用)。
|
||||
* @property {Boolean} isValid
|
||||
* @default true
|
||||
* @readOnly
|
||||
* @example
|
||||
* cc.log(obj.isValid);
|
||||
*/
|
||||
JS.get(prototype, 'isValid', function () {
|
||||
return !(this._objFlags & Destroyed);
|
||||
@@ -210,14 +228,20 @@ JS.get(prototype, 'isValid', function () {
|
||||
var deferredDestroyTimer = null;
|
||||
|
||||
/**
|
||||
* Destroy this Object, and release all its own references to other objects.
|
||||
*
|
||||
* After destroy, this CCObject is not usable any more.
|
||||
* !#en
|
||||
* Destroy this Object, and release all its own references to other objects.<br/>
|
||||
* <br/>
|
||||
* After destroy, this CCObject is not usable any more.<br/>
|
||||
* You can use cc.isValid(obj) (or obj.isValid if obj is non-nil) to check whether the object is destroyed before
|
||||
* accessing it.
|
||||
*
|
||||
* !#zh
|
||||
* 销毁该对象,并释放所有它对其它对象的引用。<br/>
|
||||
* 销毁后,CCObject 不再可用。<br/>
|
||||
* 您可以在访问对象之前使用 cc.isValid(obj)(或 obj.isValid 如果 obj 不为 null)来检查对象是否已被销毁。
|
||||
* @method destroy
|
||||
* @return {Boolean} whether it is the first time the destroy being called
|
||||
* @example
|
||||
* obj.destroy();
|
||||
*/
|
||||
prototype.destroy = function () {
|
||||
if (this._objFlags & Destroyed) {
|
||||
@@ -239,10 +263,15 @@ prototype.destroy = function () {
|
||||
|
||||
if (CC_DEV) {
|
||||
/**
|
||||
* !#en
|
||||
* In fact, Object's "destroy" will not trigger the destruct operation in Firebal Editor.
|
||||
* The destruct operation will be executed by Undo system later.
|
||||
*
|
||||
* !#zh
|
||||
* 事实上,对象的 “destroy” 不会在编辑器中触发析构操作,
|
||||
* 析构操作将在 Undo 系统中延后执行。
|
||||
* @method realDestroyInEditor
|
||||
* @example
|
||||
* cc.log(obj.realDestroyInEditor());
|
||||
*/
|
||||
prototype.realDestroyInEditor = function () {
|
||||
if (this._objFlags & Destroyed) {
|
||||
@@ -342,10 +371,13 @@ prototype._deserialize = null;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Checks whether the object is non-nil and not yet destroyed
|
||||
* !#en Checks whether the object is non-nil and not yet destroyed.
|
||||
* !#zh 检查该对象是否不为 null 并且尚未销毁。
|
||||
* @method isValid
|
||||
* @param {any} value
|
||||
* @return {Boolean} whether is valid
|
||||
* @example
|
||||
* cc.log(cc.isValid(target));
|
||||
*/
|
||||
cc.isValid = function (value) {
|
||||
if (typeof value === 'object') {
|
||||
|
||||
@@ -367,7 +367,7 @@ var View = cc._Class.extend({
|
||||
* @param {Boolean} enabled - Enable or disable retina display
|
||||
*/
|
||||
enableRetina: function(enabled) {
|
||||
this._retinaEnabled = enabled ? true : false;
|
||||
this._retinaEnabled = !!enabled;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1303,6 +1303,5 @@ cc.Scale9Sprite.RenderingType = cc.Enum({
|
||||
cc.Scale9Sprite.FillType = cc.Enum({
|
||||
HORIZONTAL: 0,
|
||||
VERTICAL: 1,
|
||||
//todo implement this
|
||||
RADIAL:2,
|
||||
});
|
||||
|
||||
+468
-129
File diff suppressed because it is too large
Load Diff
@@ -731,9 +731,9 @@ var TiledMap = cc.Class({
|
||||
} else {
|
||||
// tmx file is cleared
|
||||
// 1. hide the tmx layers in _sgNode
|
||||
var layers = self._sgNode.allLayers();
|
||||
var layers = sgNode.allLayers();
|
||||
for (var i = 0, n = layers.length; i < n; i++) {
|
||||
self._sgNode.removeChild(layers);
|
||||
sgNode.removeChild(layers[i]);
|
||||
}
|
||||
|
||||
// 2. if the component is enabled,
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
node.setPosition(cc.v2(0, 0));
|
||||
node.setPosition(0, 0);
|
||||
@@ -294,8 +294,11 @@ sp.Skeleton = cc.Class({
|
||||
// IMPLEMENT
|
||||
|
||||
onLoad: function () {
|
||||
// sgNode 的尺寸不是很可靠 同时 Node 的框框也没办法和渲染匹配 只好强制尺寸为零
|
||||
var Flags = cc.Object.Flags;
|
||||
this._objFlags |= (Flags.IsAnchorLocked | Flags.IsSizeLocked);
|
||||
this.node.setContentSize(0, 0);
|
||||
//
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
@@ -736,6 +739,7 @@ sp.Skeleton = cc.Class({
|
||||
var sgNode = self._sgNode = self._createSgNode();
|
||||
if (sgNode) {
|
||||
sgNode.retain();
|
||||
sgNode.setContentSize(0, 0); // restore content size
|
||||
self._initSgNode();
|
||||
self._appendSgNode(sgNode);
|
||||
if ( !self.node._sizeProvider ) {
|
||||
@@ -743,9 +747,6 @@ sp.Skeleton = cc.Class({
|
||||
}
|
||||
}
|
||||
|
||||
// sgNode 的尺寸不是很可靠 同时 Node 的框框也没办法和渲染匹配 只好先强制尺寸为零
|
||||
self.node.setContentSize(0, 0);
|
||||
|
||||
if (CC_EDITOR) {
|
||||
// update inspector
|
||||
self._updateAnimEnum();
|
||||
|
||||
@@ -42,6 +42,13 @@ cc.defineGetterSetter(_p, 'delegate', null, _p.setDelegate);
|
||||
cc.defineGetterSetter(_p, 'inputMode', null, _p.setInputMode);
|
||||
cc.defineGetterSetter(_p, 'returnType', null, _p.setReturnType);
|
||||
|
||||
_p._setMaxLength = _p.setMaxLength;
|
||||
_p.setMaxLength = function(maxLength) {
|
||||
if (maxLength == -1) {
|
||||
maxLength = Number.MAX_VALUE;
|
||||
}
|
||||
this._setMaxLength(maxLength);
|
||||
}
|
||||
|
||||
_p.editBoxEditingDidBegin = function (sender) {
|
||||
this.editBoxEditingDidBegan(sender);
|
||||
|
||||
@@ -1,470 +0,0 @@
|
||||
{
|
||||
"module" : {
|
||||
"actions" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/actions/CCAction.js",
|
||||
"cocos2d/actions/CCActionInterval.js",
|
||||
"cocos2d/actions/CCActionInstant.js",
|
||||
"cocos2d/actions/CCActionCamera.js",
|
||||
"cocos2d/actions/CCActionEase.js",
|
||||
"cocos2d/actions/CCActionCatmullRom.js",
|
||||
"cocos2d/actions/CCActionTween.js"
|
||||
],
|
||||
"actions3d" : [
|
||||
"core", "kazmath", "shaders", "actions", "effects", "render-texture",
|
||||
|
||||
"cocos2d/actions3d/CCActionGrid.js",
|
||||
"cocos2d/actions3d/CCActionGrid3D.js",
|
||||
"cocos2d/actions3d/CCActionTiledGrid.js",
|
||||
"cocos2d/actions3d/CCActionPageTurn3D.js"
|
||||
],
|
||||
"audio" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/audio/CCAudio.js"
|
||||
],
|
||||
"clipping-nodes" : [
|
||||
"core", "shape-nodes",
|
||||
|
||||
"cocos2d/clipping-nodes/CCClippingNode.js",
|
||||
"cocos2d/clipping-nodes/CCClippingNodeCanvasRenderCmd.js",
|
||||
"cocos2d/clipping-nodes/CCClippingNodeWebGLRenderCmd.js"
|
||||
],
|
||||
"compression" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/compression/ZipUtils.js",
|
||||
"cocos2d/compression/base64.js",
|
||||
"cocos2d/compression/gzip.js",
|
||||
"cocos2d/compression/zlib.min.js"
|
||||
],
|
||||
"core" : [
|
||||
"cocos2d/core/event-manager/CCEventHelper.js",
|
||||
"Base64Images.js",
|
||||
"cocos2d/core/platform/CCClass.js",
|
||||
"cocos2d/core/platform/CCCommon.js",
|
||||
"cocos2d/core/platform/CCSAXParser.js",
|
||||
"cocos2d/core/platform/CCConfig.js",
|
||||
"cocos2d/core/platform/miniFramework.js",
|
||||
"cocos2d/core/platform/CCMacro.js",
|
||||
"cocos2d/core/platform/CCEGLView.js",
|
||||
"cocos2d/core/platform/CCScreen.js",
|
||||
"cocos2d/core/platform/CCVisibleRect.js",
|
||||
|
||||
"cocos2d/core/support/CCVertex.js",
|
||||
"cocos2d/core/support/TransformUtils.js",
|
||||
"cocos2d/core/event-manager/CCTouch.js",
|
||||
|
||||
"cocos2d/core/event-manager/CCSystemEvent.js",
|
||||
"cocos2d/core/event-manager/CCEventListener.js",
|
||||
"cocos2d/core/event-manager/CCEventManager.js",
|
||||
|
||||
"cocos2d/core/renderer/RendererCanvas.js",
|
||||
"cocos2d/core/renderer/RendererWebGL.js",
|
||||
|
||||
"cocos2d/core/base-nodes/BaseNodesPropertyDefine.js",
|
||||
"cocos2d/core/base-nodes/CCSGNode.js",
|
||||
"cocos2d/core/base-nodes/CCSGNodeCanvasRenderCmd.js",
|
||||
"cocos2d/core/base-nodes/CCSGNodeWebGLRenderCmd.js",
|
||||
"cocos2d/core/base-nodes/CCAtlasNode.js",
|
||||
"cocos2d/core/base-nodes/CCAtlasNodeCanvasRenderCmd.js",
|
||||
"cocos2d/core/base-nodes/CCAtlasNodeWebGLRenderCmd.js",
|
||||
|
||||
"cocos2d/core/textures/CCTexture2D.js",
|
||||
"cocos2d/core/textures/CCTextureCache.js",
|
||||
"cocos2d/core/textures/CCTextureAtlas.js",
|
||||
|
||||
"cocos2d/core/scenes/CCSGScene.js",
|
||||
"cocos2d/core/scenes/CCLoaderScene.js",
|
||||
|
||||
"cocos2d/core/layers/CCLayer.js",
|
||||
"cocos2d/core/layers/CCLayerCanvasRenderCmd.js",
|
||||
"cocos2d/core/layers/CCLayerWebGLRenderCmd.js",
|
||||
|
||||
"cocos2d/core/sprites/SpritesPropertyDefine.js",
|
||||
"cocos2d/core/sprites/CCSGSprite.js",
|
||||
"cocos2d/core/sprites/CCSGSpriteCanvasRenderCmd.js",
|
||||
"cocos2d/core/sprites/CCSGSpriteWebGLRenderCmd.js",
|
||||
"cocos2d/core/sprites/CCSpriteBatchNode.js",
|
||||
"cocos2d/core/sprites/CCSpriteBatchNodeCanvasRenderCmd.js",
|
||||
"cocos2d/core/sprites/CCSpriteBatchNodeWebGLRenderCmd.js",
|
||||
"cocos2d/core/sprites/CCBakeSprite.js",
|
||||
"cocos2d/core/sprites/CCAnimation.js",
|
||||
"cocos2d/core/sprites/CCAnimationCache.js",
|
||||
"cocos2d/core/sprites/CCSpriteFrame.js",
|
||||
"cocos2d/core/sprites/CCSpriteFrameCache.js",
|
||||
"cocos2d/core/CCConfiguration.js",
|
||||
|
||||
"cocos2d/core/CCCamera.js",
|
||||
"cocos2d/core/CCScheduler.js",
|
||||
"cocos2d/core/CCDrawingPrimitivesCanvas.js",
|
||||
"cocos2d/core/CCDrawingPrimitivesWebGL.js",
|
||||
|
||||
"cocos2d/core/labelttf/LabelTTFPropertyDefine.js",
|
||||
"cocos2d/core/labelttf/CCLabelTTF.js",
|
||||
"cocos2d/core/labelttf/CCLabelTTFCanvasRenderCmd.js",
|
||||
"cocos2d/core/labelttf/CCLabelTTFWebGLRenderCmd.js",
|
||||
|
||||
"cocos2d/core/CCActionManager.js"
|
||||
],
|
||||
"effects" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/effects/CCGrid.js",
|
||||
"cocos2d/effects/CCGrabber.js"
|
||||
],
|
||||
"kazmath" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/kazmath/utility.js",
|
||||
"cocos2d/kazmath/vec2.js",
|
||||
"cocos2d/kazmath/vec3.js",
|
||||
"cocos2d/kazmath/vec4.js",
|
||||
"cocos2d/kazmath/ray2.js",
|
||||
"cocos2d/kazmath/mat3.js",
|
||||
"cocos2d/kazmath/mat4.js",
|
||||
"cocos2d/kazmath/plane.js",
|
||||
"cocos2d/kazmath/quaternion.js",
|
||||
"cocos2d/kazmath/aabb.js",
|
||||
"cocos2d/kazmath/gl/mat4stack.js",
|
||||
"cocos2d/kazmath/gl/matrix.js"
|
||||
],
|
||||
"kazmathSIMD" : [
|
||||
"kazmath",
|
||||
|
||||
"cocos2d/kazmath/vec3SIMD.js",
|
||||
"cocos2d/kazmath/mat4SIMD.js",
|
||||
"cocos2d/kazmath/SIMDPolyfill.js"
|
||||
],
|
||||
"labels" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/labels/CCLabelAtlas.js",
|
||||
"cocos2d/labels/CCLabelAtlasCanvasRenderCmd.js",
|
||||
"cocos2d/labels/CCLabelAtlasWebGLRenderCmd.js",
|
||||
"cocos2d/labels/CCLabelBMFont.js",
|
||||
"cocos2d/labels/CCLabelBMFontCanvasRenderCmd.js",
|
||||
"cocos2d/labels/CCLabelBMFontWebGLRenderCmd.js"
|
||||
],
|
||||
"menus" : [
|
||||
"core", "actions",
|
||||
|
||||
"cocos2d/menus/CCMenuItem.js",
|
||||
"cocos2d/menus/CCMenu.js"
|
||||
],
|
||||
"motion-streak" : [
|
||||
"core", "shaders", "kazmath", "labels",
|
||||
|
||||
"cocos2d/motion-streak/CCMotionStreak.js",
|
||||
"cocos2d/motion-streak/CCMotionStreakWebGLRenderCmd.js"
|
||||
],
|
||||
"node-grid" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/node-grid/CCNodeGrid.js",
|
||||
"cocos2d/node-grid/CCNodeGridWebGLRenderCmd.js"
|
||||
],
|
||||
"parallax" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/parallax/CCParallaxNode.js",
|
||||
"cocos2d/parallax/CCParallaxNodeRenderCmd.js"
|
||||
],
|
||||
"particle" : [
|
||||
"core", "compression",
|
||||
|
||||
"cocos2d/particle/CCPNGReader.js",
|
||||
"cocos2d/particle/CCTIFFReader.js",
|
||||
"cocos2d/particle/CCSGParticleSystem.js",
|
||||
"cocos2d/particle/CCSGParticleSystemCanvasRenderCmd.js",
|
||||
"cocos2d/particle/CCSGParticleSystemWebGLRenderCmd.js",
|
||||
"cocos2d/particle/CCSGParticleExamples.js",
|
||||
"cocos2d/particle/CCParticleBatchNode.js",
|
||||
"cocos2d/particle/CCParticleBatchNodeCanvasRenderCmd.js",
|
||||
"cocos2d/particle/CCParticleBatchNodeWebGLRenderCmd.js"
|
||||
],
|
||||
"physics" : [
|
||||
"core", "shape-nodes",
|
||||
|
||||
"cocos2d/physics/CCPhysicsSprite.js",
|
||||
"cocos2d/physics/CCPhysicsDebugNode.js",
|
||||
"cocos2d/physics/CCPhysicsDebugNodeCanvasRenderCmd.js",
|
||||
"cocos2d/physics/CCPhysicsDebugNodeWebGLRenderCmd.js",
|
||||
"cocos2d/physics/CCPhysicsSpriteCanvasRenderCmd.js",
|
||||
"cocos2d/physics/CCPhysicsSpriteWebGLRenderCmd.js"
|
||||
],
|
||||
"progress-timer" : [
|
||||
"core", "actions",
|
||||
|
||||
"cocos2d/progress-timer/CCProgressTimer.js",
|
||||
"cocos2d/progress-timer/CCActionProgressTimer.js",
|
||||
"cocos2d/progress-timer/CCProgressTimerCanvasRenderCmd.js",
|
||||
"cocos2d/progress-timer/CCProgressTimerWebGLRenderCmd.js"
|
||||
],
|
||||
"render-texture" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/render-texture/CCRenderTexture.js",
|
||||
"cocos2d/render-texture/CCRenderTextureCanvasRenderCmd.js",
|
||||
"cocos2d/render-texture/CCRenderTextureWebGLRenderCmd.js"
|
||||
],
|
||||
"shaders" : [
|
||||
"core", "kazmath",
|
||||
|
||||
"cocos2d/shaders/CCShaders.js",
|
||||
"cocos2d/shaders/CCShaderCache.js",
|
||||
"cocos2d/shaders/CCGLProgram.js",
|
||||
"cocos2d/shaders/CCGLStateCache.js"
|
||||
],
|
||||
"shape-nodes" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/shape-nodes/CCDrawNode.js",
|
||||
"cocos2d/shape-nodes/CCDrawNodeCanvasRenderCmd.js",
|
||||
"cocos2d/shape-nodes/CCDrawNodeWebGLRenderCmd.js"
|
||||
],
|
||||
"text-input" : [
|
||||
"core",
|
||||
|
||||
"cocos2d/text-input/CCIMEDispatcher.js",
|
||||
"cocos2d/text-input/CCTextFieldTTF.js"
|
||||
],
|
||||
"tilemap" : [
|
||||
"core", "compression",
|
||||
|
||||
"cocos2d/tilemap/CCTGAlib.js",
|
||||
"cocos2d/tilemap/CCTMXTiledMap.js",
|
||||
"cocos2d/tilemap/CCTMXXMLParser.js",
|
||||
"cocos2d/tilemap/CCTMXObjectGroup.js",
|
||||
"cocos2d/tilemap/CCTMXLayer.js",
|
||||
"cocos2d/tilemap/CCTMXLayerCanvasRenderCmd.js",
|
||||
"cocos2d/tilemap/CCTMXLayerWebGLRenderCmd.js"
|
||||
],
|
||||
"transitions" : [
|
||||
"core", "actions", "render-texture", "progress-timer",
|
||||
|
||||
"cocos2d/transitions/CCTransition.js",
|
||||
"cocos2d/transitions/CCTransitionProgress.js",
|
||||
"cocos2d/transitions/CCTransitionPageTurn.js"
|
||||
],
|
||||
|
||||
"base4webgl" : ["core", "kazmath", "shaders"],
|
||||
"cocos2d" : [
|
||||
"core", "kazmath", "shaders", "render-texture", "motion-streak", "node-grid",
|
||||
"clipping-nodes", "effects", "shape-nodes", "actions", "actions3d",
|
||||
"progress-timer", "transitions", "labels", "compression", "particle",
|
||||
"text-input", "menus", "tilemap", "parallax", "audio"
|
||||
],
|
||||
|
||||
"ccbreader" : [
|
||||
"core", "audio", "gui", "menus", "particle", "actions", "labels",
|
||||
|
||||
"extensions/ccb-reader/CCNodeLoader.js",
|
||||
"extensions/ccb-reader/CCBReaderUtil.js",
|
||||
"extensions/ccb-reader/CCControlLoader.js",
|
||||
"extensions/ccb-reader/CCSpriteLoader.js",
|
||||
"extensions/ccb-reader/CCNodeLoaderLibrary.js",
|
||||
"extensions/ccb-reader/CCBReader.js",
|
||||
"extensions/ccb-reader/CCBValue.js",
|
||||
"extensions/ccb-reader/CCBKeyframe.js",
|
||||
"extensions/ccb-reader/CCBSequence.js",
|
||||
"extensions/ccb-reader/CCBRelativePositioning.js",
|
||||
"extensions/ccb-reader/CCBAnimationManager.js"
|
||||
],
|
||||
"ccpool" : [
|
||||
"core",
|
||||
|
||||
"extensions/ccpool/CCPool.js"
|
||||
],
|
||||
"ccui" : [
|
||||
"core", "actions", "labels", "text-input","clipping-nodes",
|
||||
"extensions/ccui/base-classes/CCProtectedNode.js",
|
||||
"extensions/ccui/base-classes/CCProtectedNodeCanvasRenderCmd.js",
|
||||
"extensions/ccui/base-classes/CCProtectedNodeWebGLRenderCmd.js",
|
||||
"extensions/ccui/system/CocosGUI.js",
|
||||
"extensions/ccui/base-classes/UIWidget.js",
|
||||
"extensions/ccui/base-classes/UIWidgetRenderCmd.js",
|
||||
"extensions/ccui/base-classes/UIScale9Sprite.js",
|
||||
"extensions/ccui/base-classes/UIScale9SpriteCanvasRenderCmd.js",
|
||||
"extensions/ccui/base-classes/UIScale9SpriteWebGLRenderCmd.js",
|
||||
"extensions/ccui/layouts/UILayout.js",
|
||||
"extensions/ccui/layouts/UILayoutCanvasRenderCmd.js",
|
||||
"extensions/ccui/layouts/UILayoutWebGLRenderCmd.js",
|
||||
"extensions/ccui/layouts/UILayoutParameter.js",
|
||||
"extensions/ccui/layouts/UILayoutManager.js",
|
||||
"extensions/ccui/layouts/UIHBox.js",
|
||||
"extensions/ccui/layouts/UIRelativeBox.js",
|
||||
"extensions/ccui/layouts/UIVBox.js",
|
||||
"extensions/ccui/system/UIHelper.js",
|
||||
"extensions/ccui/uiwidgets/UIButton.js",
|
||||
"extensions/ccui/uiwidgets/UICheckBox.js",
|
||||
"extensions/ccui/uiwidgets/UIImageView.js",
|
||||
"extensions/ccui/uiwidgets/UILoadingBar.js",
|
||||
"extensions/ccui/uiwidgets/UISlider.js",
|
||||
"extensions/ccui/uiwidgets/UIText.js",
|
||||
"extensions/ccui/uiwidgets/UITextAtlas.js",
|
||||
"extensions/ccui/uiwidgets/UITextBMFont.js",
|
||||
"extensions/ccui/uiwidgets/UITextField.js",
|
||||
"extensions/ccui/uiwidgets/UIVideoPlayer.js",
|
||||
"extensions/ccui/uiwidgets/UIRichText.js",
|
||||
"extensions/ccui/uiwidgets/UIWebView.js",
|
||||
"extensions/ccui/uiwidgets/scroll-widget/UIScrollView.js",
|
||||
"extensions/ccui/uiwidgets/scroll-widget/UIListView.js",
|
||||
"extensions/ccui/uiwidgets/scroll-widget/UIPageView.js",
|
||||
"extensions/ccui/uiwidgets/scroll-widget/UIScrollViewCanvasRenderCmd.js",
|
||||
"extensions/ccui/uiwidgets/scroll-widget/UIScrollViewWebGLRenderCmd.js"
|
||||
],
|
||||
"cocostudio" : [
|
||||
"core", "tilemap", "particle", "shape-nodes", "ccui",
|
||||
|
||||
"extensions/cocostudio/components/CCComponent.js",
|
||||
"extensions/cocostudio/components/CCComponentContainer.js",
|
||||
"extensions/ccui/layouts/UILayoutComponent.js",
|
||||
"extensions/cocostudio/CocoStudio.js",
|
||||
|
||||
"extensions/cocostudio/armature/utils/CCArmatureDefine.js",
|
||||
"extensions/cocostudio/armature/utils/CCDataReaderHelper.js",
|
||||
"extensions/cocostudio/armature/utils/CCSpriteFrameCacheHelper.js",
|
||||
"extensions/cocostudio/armature/utils/CCTransformHelp.js",
|
||||
"extensions/cocostudio/armature/utils/CCTweenFunction.js",
|
||||
"extensions/cocostudio/armature/utils/CCUtilMath.js",
|
||||
"extensions/cocostudio/armature/utils/CCArmatureDataManager.js",
|
||||
"extensions/cocostudio/armature/datas/CCDatas.js",
|
||||
"extensions/cocostudio/armature/display/CCDecorativeDisplay.js",
|
||||
"extensions/cocostudio/armature/display/CCDisplayFactory.js",
|
||||
"extensions/cocostudio/armature/display/CCDisplayManager.js",
|
||||
"extensions/cocostudio/armature/display/CCSkin.js",
|
||||
"extensions/cocostudio/armature/display/CCSkinCanvasRenderCmd.js",
|
||||
"extensions/cocostudio/armature/display/CCSkinWebGLRenderCmd.js",
|
||||
"extensions/cocostudio/armature/animation/CCProcessBase.js",
|
||||
"extensions/cocostudio/armature/animation/CCArmatureAnimation.js",
|
||||
"extensions/cocostudio/armature/animation/CCTween.js",
|
||||
"extensions/cocostudio/armature/physics/CCColliderDetector.js",
|
||||
"extensions/cocostudio/armature/CCArmature.js",
|
||||
"extensions/cocostudio/armature/CCArmatureCanvasRenderCmd.js",
|
||||
"extensions/cocostudio/armature/CCArmatureWebGLRenderCmd.js",
|
||||
"extensions/cocostudio/armature/CCBone.js",
|
||||
|
||||
"extensions/cocostudio/action/CCActionFrame.js",
|
||||
"extensions/cocostudio/action/CCActionManager.js",
|
||||
"extensions/cocostudio/action/CCActionNode.js",
|
||||
"extensions/cocostudio/action/CCActionObject.js",
|
||||
|
||||
"extensions/cocostudio/components/CCComAttribute.js",
|
||||
"extensions/cocostudio/components/CCComAudio.js",
|
||||
"extensions/cocostudio/components/CCComController.js",
|
||||
"extensions/cocostudio/components/CCComRender.js",
|
||||
|
||||
"extensions/cocostudio/trigger/ObjectFactory.js",
|
||||
"extensions/cocostudio/trigger/TriggerBase.js",
|
||||
"extensions/cocostudio/trigger/TriggerMng.js",
|
||||
"extensions/cocostudio/trigger/TriggerObj.js",
|
||||
|
||||
"extensions/cocostudio/timeline/ActionTimeline.js",
|
||||
"extensions/cocostudio/timeline/Frame.js",
|
||||
"extensions/cocostudio/timeline/Timeline.js",
|
||||
|
||||
"extensions/cocostudio/timeline/CCSkinNode.js",
|
||||
"extensions/cocostudio/timeline/CCBoneNode.js",
|
||||
"extensions/cocostudio/timeline/CCSkeletonNode.js",
|
||||
|
||||
"extensions/cocostudio/loader/load.js",
|
||||
"extensions/cocostudio/loader/parsers/scene-1.x.js",
|
||||
"extensions/cocostudio/loader/parsers/uiParser-1.x.js",
|
||||
"extensions/cocostudio/loader/parsers/action-1.x.js",
|
||||
"extensions/cocostudio/loader/parsers/action-2.x.js",
|
||||
"extensions/cocostudio/loader/parsers/timelineParser-1.x.js",
|
||||
"extensions/cocostudio/loader/parsers/timelineParser-2.x.js",
|
||||
"extensions/cocostudio/loader/parsers/compatible.js"
|
||||
|
||||
|
||||
],
|
||||
"gui" : [
|
||||
"core", "clipping-nodes", "render-texture", "actions", "progress-timer",
|
||||
|
||||
"extensions/gui/control-extension/CCControl.js",
|
||||
"extensions/gui/control-extension/CCControlButton.js",
|
||||
"extensions/gui/control-extension/CCControlUtils.js",
|
||||
"extensions/gui/control-extension/CCInvocation.js",
|
||||
"extensions/gui/control-extension/CCMenuPassive.js",
|
||||
"extensions/gui/control-extension/CCControlSaturationBrightnessPicker.js",
|
||||
"extensions/gui/control-extension/CCControlHuePicker.js",
|
||||
"extensions/gui/control-extension/CCControlColourPicker.js",
|
||||
"extensions/gui/control-extension/CCControlSlider.js",
|
||||
"extensions/gui/control-extension/CCControlSwitch.js",
|
||||
"extensions/gui/control-extension/CCControlStepper.js",
|
||||
"extensions/gui/control-extension/CCControlPotentiometer.js",
|
||||
"extensions/gui/scrollview/CCScrollView.js",
|
||||
"extensions/gui/scrollview/CCScrollViewCanvasRenderCmd.js",
|
||||
"extensions/gui/scrollview/CCScrollViewWebGLRenderCmd.js",
|
||||
"extensions/gui/scrollview/CCSorting.js",
|
||||
"extensions/gui/scrollview/CCTableView.js"
|
||||
],
|
||||
|
||||
"pluginx" : [
|
||||
"core",
|
||||
|
||||
"external/pluginx/Plugin.js"
|
||||
],
|
||||
"plugin-facebook" : [
|
||||
"external/pluginx/platform/facebook_sdk.js",
|
||||
"external/pluginx/platform/facebook.js"
|
||||
],
|
||||
|
||||
"spine":[
|
||||
"core",
|
||||
|
||||
"extensions/spine/Spine.js",
|
||||
"extensions/spine/CCSkeleton.js",
|
||||
"extensions/spine/CCSkeletonAnimation.js",
|
||||
"extensions/spine/CCSkeletonCanvasRenderCmd.js",
|
||||
"extensions/spine/CCSkeletonWebGLRenderCmd.js"
|
||||
],
|
||||
"gaf":[
|
||||
"core",
|
||||
|
||||
"external/gaf/GAFMacros.js",
|
||||
"external/gaf/GAFBoot.js",
|
||||
"external/gaf/Library/GAFAssetPreload.js",
|
||||
"external/gaf/Library/GAFAsset.js",
|
||||
"external/gaf/Library/GAFObject.js",
|
||||
"external/gaf/Library/GAFTimeLine.js",
|
||||
"external/gaf/Library/GAFTextField.js",
|
||||
"external/gaf/Library/GAFSprite.js",
|
||||
"external/gaf/Library/GAFMask.js",
|
||||
"external/gaf/Library/GAFSpriteCanvasRenderCmd.js",
|
||||
"external/gaf/Library/GAFSpriteWebGLRenderCmd.js",
|
||||
"external/gaf/Library/GAFTimeLineProto.js",
|
||||
"external/gaf/Library/GAFSpriteProto.js",
|
||||
"external/gaf/Library/GAFMaskProto.js",
|
||||
"external/gaf/Library/GAFTags.js",
|
||||
"external/gaf/Library/GAFLoader.js",
|
||||
"external/gaf/Library/GAFDataReader.js",
|
||||
"external/gaf/Library/GAFShaders.js",
|
||||
"external/gaf/Library/GAFShaderManager.js",
|
||||
"external/gaf/Library/GAFAtlasLoader.js"
|
||||
],
|
||||
"extensions" : ["gui", "ccbreader", "editbox", "cocostudio", "spine", "ccpool"],
|
||||
|
||||
"box2d" : [
|
||||
"core", "physics",
|
||||
|
||||
"external/box2d/box2d.js"
|
||||
],
|
||||
"chipmunk" : [
|
||||
"core", "physics",
|
||||
|
||||
"external/chipmunk/chipmunk.js"
|
||||
],
|
||||
"runtime":[
|
||||
"core",
|
||||
"extensions/runtime/CCLoaderLayer.js"
|
||||
],
|
||||
"socketio" : [
|
||||
"external/socketio/socket.io.min.js"
|
||||
],
|
||||
"external" : ["box2d", "chipmunk", "socketio", "pluginx", "gaf"]
|
||||
},
|
||||
"bootFile" : "CCBoot.js"
|
||||
}
|
||||
Reference in New Issue
Block a user