Skip to content

Commit c464a00

Browse files
committed
Merge pull request cocos2d#551 from pandamicro/master
Release #5636: Update docs and cocos2d-html5 ref
2 parents f125577 + 0199f3c commit c464a00

File tree

3 files changed

+31
-21
lines changed

3 files changed

+31
-21
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Furthermore, javascript friendly API makes your game development experience a br
1111

1212
## API Reference
1313

14-
- API Reference: [Online API reference](http://www.cocos2d-x.org/reference/html5-js/V3.0beta/index.html)
14+
- API Reference: [Online API reference](http://www.cocos2d-x.org/reference/html5-js/V3.0rc0/index.html)
1515

1616
- And you can download it from
17-
[Cocos2d-JS-v3.0-beta-API.zip](http://www.cocos2d-x.org/filedown/Cocos2d-JS-v3.0-beta-API.zip)
17+
[Cocos2d-JS-v3.0-rc0-API.zip](http://www.cocos2d-x.org/filedown/Cocos2d-JS-v3.0-rc0-API.zip)
1818

1919
## Online demo
2020
- [MoonWarriors](http://www.cocos2d-x.org/MoonWarriors/index.html)

docs/upgrade-guide-from-2.x-to-3.0beta.md

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
```
4646
cc.game.onStart = function(){
47-
cc.Director.getInstance().runScene(new MyScene());
47+
cc.director.runScene(new MyScene());
4848
};
4949
cc.game.run();
5050
```
@@ -219,7 +219,7 @@ In Cocos2d-JS v3.0 alpha, we have made a great improvement, we merged all `creat
219219
```
220220
var sprite = cc.Sprite.create(filename, rect);
221221
var sprite = cc.Sprite.create(texture, rect);
222-
var sprite = cc.Sprite.create(spriteFrameName);
222+
var sprite = cc.Sprite.create("#" + spriteFrameName);
223223
```
224224
225225
This changement affect not only cc.Sprite, but all similar classes, all classes and details about create function refactoration can be found in [this document](../../../v3.0/create-api/en.md).
@@ -229,7 +229,7 @@ As we never stop to improve our engine, in Cocos2d-JS v3.0 alpha2, we have made
229229
```
230230
var sprite = new cc.Sprite(filename, rect);
231231
var sprite = new cc.Sprite(texture, rect);
232-
var sprite = new cc.Sprite(spriteFrameName);
232+
var sprite = new cc.Sprite("#" + spriteFrameName);
233233
```
234234
235235
In the meantime, for backward compatibility, we have kept all `create` functions also, so it's totally your choice. What's more important with this improvement is that the inheritance is much easier than before. Developers can now completely ignore all `initXXX` functions, you can simply override `ctor` function and call `this._super` with correct parameters, then your object will be correctly initialized:
@@ -246,7 +246,7 @@ var Enemy = cc.Sprite.extend({
246246
var enemy1 = new Enemy(100);
247247
```
248248
249-
As you can see, there isn't a single `init` function call, very convenient to use. All cocos2d (no extension) classes have been refactored to support this style, and JSB support it too. [This document](../../../v3.0/inheritance/en) discuss the `new` constructor and the inheritance in detail.
249+
As you can see, there isn't a single `init` function call, very convenient to use. All cocos2d and extension classes have been refactored to support this style, and JSB support it too. [This document](../../../v3.0/inheritance/en) discuss the `new` constructor and the inheritance in detail.
250250
251251
252252
##8. GUI widgets
@@ -359,6 +359,8 @@ if (cc.sys.isNative) {
359359
cc.fileUtils.fullPathForFilename(filename)
360360
cc.fileUtils.loadFilenameLookup(filename)
361361
cc.fileUtils.getStringFromFile(filename)
362+
cc.fileUtils.getByteArrayFromFile(filename) // [New in beta]
363+
cc.fileUtils.createDictionaryWithContentsOfFile(filename) // [New in beta]
362364
cc.fileUtils.isAbsolutePath(path)
363365
cc.fileUtils.isPopupNotify()
364366
cc.fileUtils.getValueVectorFromFile(filename)
@@ -368,9 +370,14 @@ if (cc.sys.isNative) {
368370
cc.fileUtils.purgeCachedEntries()
369371
cc.fileUtils.fullPathFromRelativeFile(filename, relativeFile)
370372
cc.fileUtils.getWritablePath()
373+
cc.fileUtils.addSearchPath(path) // [New in beta]
374+
cc.fileUtils.setSearchPaths(pathArray) // [New in beta]
375+
cc.fileUtils.getSearchPaths() // [New in beta]
376+
cc.fileUtils.setSearchResolutionsOrder(orderArray) // [New in beta]
377+
cc.fileUtils.getSearchResolutionsOrder() // [New in beta]
371378
```
372379
373-
All functions about search path configuration have been removed, because this will due to code inconsistence between Cocos2d-html5 and Cocos2d-JSB and eventually a high cost of maintainbility.
380+
Pay attention when you use functions about search path configuration, because this will due to code inconsistence between Cocos2d-html5 and Cocos2d-JSB and eventually a high cost of maintainbility. If you really need them, we suggest you to maintain two list of resources for Web and JSB, so that you can use the same resource variable name to refer to different path.
374381
375382
* **10.3** cc.AssetsManager
376383
@@ -615,6 +622,7 @@ if (cc.sys.isNative) {
615622
getCString --> getString
616623
setCString --> setString
617624
```
625+
618626
##12.[New in Beta]Actions API changements
619627
620628
* **12.1 Provide shortcut to create an action**
@@ -660,19 +668,22 @@ if (cc.sys.isNative) {
660668
661669
**Old usage:**
662670
```
663-
var anAction = cc.Sequence.create(
664-
cc.Speed.create(cc.Repeat.create(cc.EaseIn.create(cc.MoveBy.create(2, cc.p(100,50)),0.3), 5),1.7),
665-
cc.RepeatForever.create(cc.RotateBy.create(2, 30)));
671+
var anAction = cc.Sequence.create(
672+
cc.Speed.create(cc.Repeat.create(cc.EaseIn.create(cc.MoveBy.create(2, cc.p(100,50)),0.3), 5),1.7),
673+
cc.RepeatForever.create(cc.RotateBy.create(2, 30))
674+
);
666675
```
667676
668677
**New usage:**
669678
```
670679
var anAction = cc.sequence(
671-
cc.moveBy(2,cc.p(100,50)).easing(cc.easeIn(0.3).repeat(5).speed(1.7),
672-
cc.rotateBy(2,30).repeatForever());
680+
cc.moveBy(2,cc.p(100,50)).easing(cc.easeIn(0.3)).repeat(5).speed(1.7),
681+
cc.rotateBy(2,30).repeatForever()
682+
);
673683
```
674684
675685
**Note**: All actions changes are backward compatible.
686+
676687
* **12.4 The new design list**
677688
678689
Old usage | New usage
@@ -703,35 +714,34 @@ var anAction = cc.Sequence.create(
703714
704715
##13.[New in Beta]Changed setText,getText to unified API of SetString, getString
705716
706-
* ccui.Text refactoration :
707-
717+
* ccui.Text :
708718
709719
```
710720
setText --> setString
711721
getStringValue --> getString
712722
```
713723
714-
* ccui.TextAtlas
724+
* ccui.TextAtlas :
715725
716726
```
717727
getStringValue ==> getString
718728
```
719729
720-
* ccui.TextBMFont
730+
* ccui.TextBMFont :
721731
722-
```
732+
```
723733
setText --> setString
724734
getStringValue --> getString
725735
```
726736
727-
* ccui.TextField
737+
* ccui.TextField :
728738
729-
```
739+
```
730740
setText --> setString
731741
getStringValue --> getString
732742
```
733743
734-
* cc.EditBox
744+
* cc.EditBox :
735745
736746
```
737747
setText --> setString

frameworks/cocos2d-html5

Submodule cocos2d-html5 updated 1 file

0 commit comments

Comments
 (0)