Skip to content

Commit 0a89a61

Browse files
committed
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-html5 into Iss3568_FixLabelAtlasBug
2 parents 03e74b6 + f92dc6b commit 0a89a61

File tree

17 files changed

+176
-68
lines changed

17 files changed

+176
-68
lines changed

HelloHTML5World/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var cocos2dApp = cc.Application.extend({
4343
// initialize director
4444
var director = cc.Director.getInstance();
4545

46-
cc.EGLView.getInstance()._resizeWithBrowserSize(true);
46+
cc.EGLView.getInstance().resizeWithBrowserSize(true);
4747
cc.EGLView.getInstance().setDesignResolutionSize(800, 450, cc.RESOLUTION_POLICY.SHOW_ALL);
4848

4949
// turn on display FPS

cocos2d/core/platform/CCEGLView.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ cc.EGLView = cc.Class.extend(/** @lends cc.EGLView# */{
138138
this.setDesignResolutionSize(width, height, this._resolutionPolicy);
139139
},
140140

141-
_resizeWithBrowserSize: function (enabled) {
141+
resizeWithBrowserSize: function (enabled) {
142142
var adjustSize;
143143
if (enabled) {
144144
//enable

extensions/CocoStudio/Armature/CCArmature.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ccs.Armature = ccs.NodeRGBA.extend(/** @lends ccs.Armature# */{
114114
break;
115115
}
116116
bone.getTweenData().copy(frameData);
117-
bone.changeDisplayByIndex(frameData.displayIndex, false);
117+
bone.changeDisplayWithIndex(frameData.displayIndex, false);
118118
} while (0);
119119
}
120120
this.update(0);
@@ -171,7 +171,7 @@ ccs.Armature = ccs.NodeRGBA.extend(/** @lends ccs.Armature# */{
171171
}
172172

173173
bone.setBoneData(boneData);
174-
bone.getDisplayManager().changeDisplayByIndex(-1, false);
174+
bone.getDisplayManager().changeDisplayWithIndex(-1, false);
175175
return bone;
176176
},
177177

extensions/CocoStudio/Armature/CCBone.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,16 +492,26 @@ ccs.Bone = ccs.NodeRGBA.extend(/** @lends ccs.Bone# */{
492492
* @param {Boolean} force
493493
*/
494494
changeDisplayByIndex:function (index, force) {
495-
this._displayManager.changeDisplayByIndex(index, force);
495+
cc.log("changeDisplayByIndex is deprecated. Use changeDisplayWithIndex instead.");
496+
this.changeDisplayWithIndex(index, force);
496497
},
497498

498499
/**
499-
* change display by name
500+
* change display with index
501+
* @param {Number} index
502+
* @param {Boolean} force
503+
*/
504+
changeDisplayWithIndex:function (index, force) {
505+
this._displayManager.changeDisplayWithIndex(index, force);
506+
},
507+
508+
/**
509+
* change display with name
500510
* @param {String} name
501511
* @param {Boolean} force
502512
*/
503-
changeDisplayByName:function (name, force) {
504-
this._displayManager.changeDisplayByName(name, force);
513+
changeDisplayWithName:function (name, force) {
514+
this._displayManager.changeDisplayWithName(name, force);
505515
},
506516

507517
/**

extensions/CocoStudio/Armature/animation/CCArmatureAnimation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ ccs.ArmatureAnimation = ccs.ProcessBase.extend(/** @lends ccs.ArmatureAnimation#
277277
}
278278
} else {
279279
if (!bone.getIgnoreMovementBoneData()) {
280-
bone.getDisplayManager().changeDisplayByIndex(-1, false);
280+
bone.getDisplayManager().changeDisplayWithIndex(-1, false);
281281
tween.stop();
282282
}
283283
}

extensions/CocoStudio/Armature/animation/CCTween.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ ccs.Tween = ccs.ProcessBase.extend(/** @lends ccs.Tween# */{
268268
var displayIndex = keyFrameData.displayIndex;
269269
var displayManager = locBone.getDisplayManager();
270270
if (!displayManager.getForceChangeDisplay()) {
271-
displayManager.changeDisplayByIndex(displayIndex, false);
271+
displayManager.changeDisplayWithIndex(displayIndex, false);
272272

273273
}
274274
this._tweenData.zOrder = keyFrameData.zOrder;

extensions/CocoStudio/Armature/display/CCDisplayManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ccs.DisplayManager = ccs.Class.extend({
6767
//! if changed display index is current display index, then change current display to the new display
6868
if (index == this._displayIndex) {
6969
this._displayIndex = -1;
70-
this.changeDisplayByIndex(index, false);
70+
this.changeDisplayWithIndex(index, false);
7171
}
7272
},
7373

@@ -128,7 +128,7 @@ ccs.DisplayManager = ccs.Class.extend({
128128
return this._decoDisplayList;
129129
},
130130

131-
changeDisplayByIndex:function (index, force) {
131+
changeDisplayWithIndex:function (index, force) {
132132
if (index >= this._decoDisplayList.length) {
133133
cc.log("the index value is out of range");
134134
return;
@@ -160,10 +160,10 @@ ccs.DisplayManager = ccs.Class.extend({
160160
this.setCurrentDecorativeDisplay(decoDisplay);
161161
},
162162

163-
changeDisplayByName: function (name, force) {
163+
changeDisplayWithName: function (name, force) {
164164
for (var i = 0; i < this._decoDisplayList.length; i++) {
165165
if (this._decoDisplayList[i].getDisplayData().displayName == name) {
166-
this.changeDisplayByIndex(i, force);
166+
this.changeDisplayWithIndex(i, force);
167167
break;
168168
}
169169
}

extensions/CocoStudio/Components/CCComAttribute.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030
ccs.ComAttribute = ccs.Component.extend(/** @lends ccs.ComAttribute# */{
3131
_attributes: null,
3232
_jsonDict: null,
33+
_jsonName: "",
3334
ctor: function () {
3435
cc.Component.prototype.ctor.call(this);
3536
this._attributes = {};
3637
this._jsonDict = {};
37-
this._name = "ComAttribute";
38+
this._jsonName = "";
39+
this._name = "CCComAttribute";
3840
},
3941
init: function () {
4042
this._attributes = {};
@@ -181,7 +183,6 @@ ccs.ComAttribute = ccs.Component.extend(/** @lends ccs.ComAttribute# */{
181183

182184
/**
183185
* Getter of jsonDict
184-
* @returns {Object}
185186
*/
186187
getDict: function () {
187188
return this._jsonDict;
@@ -193,6 +194,21 @@ ccs.ComAttribute = ccs.Component.extend(/** @lends ccs.ComAttribute# */{
193194
*/
194195
setDict: function (dict) {
195196
this._jsonDict = dict;
197+
},
198+
199+
/**
200+
* Getter of jsonName
201+
* @returns {String}
202+
*/
203+
getJsonName:function(){
204+
return this._jsonName;
205+
},
206+
207+
/**
208+
* setter of jsonName
209+
*/
210+
setJsonName:function(jsonName){
211+
this._jsonName = jsonName;
196212
}
197213
});
198214
/**

extensions/CocoStudio/Components/CCComAudio.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ ccs.ComAudio = ccs.Component.extend(/** @lends ccs.ComAudio# */{
6464
* @param {Boolean} loop
6565
*/
6666
playBackgroundMusic: function (pszFilePath, loop) {
67-
cc.AudioEngine.getInstance().playMusic(pszFilePath, loop);
67+
if(pszFilePath){
68+
cc.AudioEngine.getInstance().playMusic(pszFilePath, loop);
69+
}else{
70+
cc.AudioEngine.getInstance().playMusic(this._filePath, this._loop);
71+
}
6872
},
6973

7074
/**
@@ -151,7 +155,11 @@ ccs.ComAudio = ccs.Component.extend(/** @lends ccs.ComAudio# */{
151155
* @returns {Boolean}
152156
*/
153157
playEffect: function (pszFilePath, loop) {
154-
return cc.AudioEngine.getInstance().playEffect(pszFilePath, loop);
158+
if (pszFilePath) {
159+
return cc.AudioEngine.getInstance().playEffect(pszFilePath, loop);
160+
} else {
161+
return cc.AudioEngine.getInstance().playEffect(this._filePath, this._loop);
162+
}
155163
},
156164

157165
/**
@@ -205,6 +213,8 @@ ccs.ComAudio = ccs.Component.extend(/** @lends ccs.ComAudio# */{
205213
*/
206214
preloadEffect: function (pszFilePath) {
207215
cc.AudioEngine.getInstance().preloadEffect(pszFilePath);
216+
this.setFile(pszFilePath);
217+
this.setLoop(false);
208218
},
209219

210220
/**

extensions/CocoStudio/Components/CCComController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
ccs.ComController = ccs.Component.extend(/** @lends ccs.ComController# */{
3131
ctor: function () {
3232
cc.Component.prototype.ctor.call(this);
33-
this._name = "ComAttribute";
33+
this._name = "ComController";
3434
},
3535
init: function () {
3636
return true;

0 commit comments

Comments
 (0)