Skip to content

Commit 5a53907

Browse files
committed
Merge pull request #1 from cocos2d/master
update
2 parents 5b826da + 4be12f1 commit 5a53907

File tree

337 files changed

+33069
-9810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

337 files changed

+33069
-9810
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,9 @@ CMakeFiles
9494
Makefile
9595
cmake_install.cmake
9696
templates/js-template-default/frameworks/js-bindings
97+
98+
# Ignore files generated by console
99+
samples/*/publish/
100+
samples/*/runtime/
101+
build/build/
102+
frameworks/js-bindings/bindings/proj.ios_mac/build/

AUTHORS

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
cocos2d-x authors & contributors
1+
Cocos2d-JS authors & contributors
22

33
(ordered by the join in time)
44

5-
Core Developers:
5+
Current Core Developers of Cocos2d-x:
66
Ricardo Quesada
77
XiaoMing Zhang (Minggo)
88
JianHua Chen (James)
@@ -12,9 +12,18 @@ Core Developers:
1212
Bo Yu (boyu0)
1313
Wenhai Lin(Dhilan007)
1414

15-
Developers:
15+
Current Core Developers of Cocos2d-html5 & JSB:
16+
Shun Lin (Sean Lin)
17+
Hao Wu (WuHao)
18+
Dingping Lv (David Lv)
19+
Ricardo Quesada
20+
Huabin LING
21+
Zhiming Wu
22+
Sijie Wang
23+
Jialong Zhai
1624

25+
For the full list of all contributors and retired core developers, please refer to the authors list of cocos2d-x and cocos2d-html5.
1726

18-
Cocos2d-x can not grow so fast without the active community.
27+
Cocos2d-JS can not grow so fast without the active community.
1928
Thanks to all developers who report & trace bugs, discuss the engine usage in forum & QQ groups!
2029
Special thanks to Ricardo Quesada for giving us lots of guidances & suggestions.

CHANGELOG

Lines changed: 122 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,123 @@
1-
cocos2d-js Feb.?? 2014
2-
[All]
3-
[NEW]
1+
Cocos2d-JS-v3.0 alpha2 @ April.14, 2014
2+
* Minimize the size of core from 254k to 113k after google closure advanced compiling.
3+
* Make engine classes can be constructed via `new` with the same parameters as create functions.
4+
* Make engine classes extendable directly via ctor.
5+
* Made cc.DrawNode support some DrawingPrimitive's drawing function on WebGL mode.
6+
* cc.Sprite supports creating a sprite through external URL.
7+
* Add SocketIO to framework's external.
8+
* Add the warning information to notice developers that their project.json cannot be loaded or parsed.
9+
* Add retina display support to cc.Editbox.
10+
* cc.Node's pauseSchedulerAndActions and resumeSchedulerAndActions are deprecated, please use pause and resume instead.
11+
* Add render mode checking to 3D action classes.
12+
* Use undefined check in cc.loader for better performance.
13+
* Sync cc.eventManager to the latest version of Cocos2d-x v3.0 final.
14+
* ccui.Layout's doLayout function has been set to private function "_doLayout".
15+
* Rename all Uppercase functions to lowercase in CCMacro.js.
16+
* Add more necessary GL constants in engine.
17+
* Rename ccs.comAttribute's `getCString` function to `getString`.
18+
* [JSB]Make engine classes extendable via ctor in JSB.
19+
* [JSB]Fix cc.DrawNode API inconsistence between Cocos2d-html5 and JSB.
20+
* [JSB]Rebind cc.fileUtils for JSB only APIs.
21+
* [JSB]Make JS level subclass of cc.Component support override of onEnter/onExit/update functions.
22+
* [JSB]Update precompiled SpiderMonkey to support iOS 64 bit devices.
23+
* [JSB]Fix constants inconsistence between Cocos2d-html5 and JSB.
24+
* [JSB]Add macro functions in CCMacro.js into JSB.
25+
* [JSB]Add `tag` property to cc.Action.
26+
* [JSB]Add `boundingBox` function to ccs.Armature.
27+
* [JSB]Add `textureLoaded` function to cc.Sprite.
28+
* [JSB]Add `allLayers` function to cc.TMXTiledMap.
29+
* [JSB]Refactor `cc.EventMouse`'s `getCursorX`, `getCursorY`, `setCursorPosition` to `getLocationX`, `getLocationY`, `setLocation`, and add `getLocation` function.
30+
* [JSB]Add `getLocationX`, `getLocationY` to `cc.Touch`.
431

5-
[FIX]
32+
* Bugs fix:
33+
1. Fixed ccs.comAttribute API incompatible issue
34+
2. Fixed a bug of CocoStudio's data reader that getting isTween value is incorrect when the attribute value is false.
35+
3. Fixed a bug of Sprite that it stops to work when its texture doesn't preload and its parent is a SpriteBatchNode
36+
4. Fixed a bug in CCBoot.js that console.error is invalid on firefox.
37+
5. Fixed a bug of cc.LabelBMFont that it's multiline works incorrectly.
38+
6. Fixed a bug that Touches event doesn't work in release mode on IE browser.
39+
7. Fixed a bug that cc.winSize has not been reset after cc.view.setDesignResolutionSize.
40+
8. Fixed typo error in ccui.Widget.TOUCH_BEGAN
41+
9. Fixed a bug of cc.MenuItemSprite.create that its can't create item when the length of arguments equals 4.
42+
10. Fixed a bug of cc.loader that it need to set value before calling the callback.
43+
11. Fixed a bug of cc.log that it doesn't work in IE9
44+
12. Fixed IE incompatible issue with __lookupGetter__
45+
13. Fixed a bug of cc.Node that it returns a reference of _position in getPosition
46+
14. Fixed a bug of cc.ClippingNode that its _super is undefined
47+
15. Fixed a bug of inputManager's touch event in IE browser
48+
16. Add callback null check to avoid bugs in cc.textureCache.addImage.
49+
17. [JSB]Fix ccui.Widget's addNode function no longer exists bug in JSB.
50+
18. [JSB]Fix a bug that main loop get stated twice.
51+
19. [JSB]API inconsistence of ccs.ArmatureAnimation.play fixed.
52+
20. [JSB]Fix JSB compiling issues by removing `DEBUG` preprocessor macro.
53+
21. Fixed some comment errors of framework.
54+
55+
* Known Issues:
56+
1. [JSB]Property's getter/setter functions can not be overrided automatically in custom subclasses.
57+
2. [JSB]CocoStudio's scene reloading may cause memory release issues and crash.
58+
3. [JSB]OpenGL test is not functionnable in JSB.
59+
4. EventListener is not extendable.
60+
5. [JSB]PhysicsSprite is not updating with physics node.
61+
6. [JSB]ccui.TextField's is not responding to keyboard backspace button.
62+
63+
Cocos2d-JS-v3.0 alpha @ March.15, 2014
64+
* Refactor some properties of all rendering classes with getter setter for providing javascript user friendly APIs.
65+
* Provide `attr` function for cc.Node and its descendants to permit modify multiple properties at the same time with a key-value object.
66+
* Refactor foundational data structures for better maintainability.
67+
* Add event manager to cocos2d-html5, all events are dispatched via cc.eventManager to event listener.
68+
* Refactor cc.Application to cc.game.
69+
* Refactor singleton Classes to javascript object.
70+
* Refactor all createWithXXX functions into unified create function with different parameters.
71+
* Use `moduleConfig.json` to config the paths of engine scripts.
72+
* `cocos2d.js` is replaced with `project.json`.
73+
* Refactoring cc.loader.
74+
* CocoStudio GUI updated to 3.0, and ccs prefix of UI widgets have been changed to ccui.
75+
* CocoStudio v1.3.0 has been supported in v3.0.
76+
* richText has been supported in v3.0.
77+
* Use `cc.BuilderReader.registerController` to register controller of ccb.
78+
* Add `cc.path` to handle operations of file path.
79+
* Add `cc.async` to handle async operations.
80+
* Add cc.NodeGrid in v3.0.
81+
* Replace `replaceWithScene` and `runWithScene` with `runScene`.
82+
* move sys.xxx to cc.sys.xxx.
83+
* Refactor CCEGLView.js for better maintainability.
84+
* Refactor CCScheduler.js for better maintainability.
85+
* Remove arguments.callee which is forbidden in ECMAScript strict mode.
86+
* Refactor Array clean function for better performance.
87+
* Refactor some functions about array operation.
88+
* Refactor FadeIn/FadeOut to fix a bug that it always start from/to 255.
89+
* Rewrite functions in CCNS.js with regex.
90+
* Move CCFormatHelper and CCNS content into CCCommon.js.
91+
* Refactor cc.Screen to support all browsers.
92+
* Add retina display support for Apple devices to cc.view.
93+
* Add "allLayers" function to cc.TMXTiledMap.
94+
* Make cc.p and cc.size support two types of parameters.
95+
* cc.DrawNode supports all functions of cc.DrawingPrimitive on Canvas mode.
96+
* WebAudioEngine is supported on iOS now.
97+
* Use event on cc.canvas to make full screen.
98+
* Add a browser white list that support multiple audio playback at the same time.
99+
* Removed in/hasOwnProperty usage in engine for better performance.
100+
* Refactoring CCCommon.js, delete some unused functions, rename some functions for better maintainability.
101+
* Add analytics plugin protocol ,Flurry plugin and ProtocolAds.js plugin protocol.
102+
* Arguments length check replaced by undefined check for better performance.
103+
* Fix legacy Function.prototype.bind support.
104+
105+
* Bugs fix:
106+
1. Avoid CCLabelTTF enter in infinite loop while character's width larger than the dimension width
107+
2. Add jsDoc Flags to cc.NodeRGBA and cc.LayerRGBA
108+
3. Fixed a bug that Schedule doesn't restart when widget is re-added after being removed
109+
4. Correction of split logic in CCLabelTTF
110+
5. Fixed a bug that armature animation does not display correctly on canvas mode
111+
6. Correct gui widget clone functions
112+
7. Fixed a bug of cc.SpriteFrameCache that filePath is needed in `loadedFileNames`
113+
8. Add a condition check to avoid texture out of range bug
114+
9. Fixed a bug of cc.Editbox that its position is incorrect when its parent node isn't root node.
115+
10. Fixed a SimpleAudioEngine's state error.
116+
11. Fixed a bug of cc.TMXTileMap that its `_tileProperties` should be a dictionary object
117+
12. Fixed a bug of cc.DrawNode that it need to deep-copy verts in `drawPoly`
118+
13. Fixed a bug of UILabelBMFont that variable `_strStringValue` should be `_stringValue`
119+
14. Fixed a bug in SceneReader's `setPropertyFromJsonDict` function
120+
15. Fixed a bug when margin not set in ccs.Margin
121+
16. Fixed a bug of cc.TMXLayer that its `removeChild` works incorrectly.
122+
123+
* Known Issues:

README.md

Lines changed: 80 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,110 @@
11
<img src="http://www.cocos2d-x.org/attachments/801/cocos2dx_portrait.png" width=200>
22

3-
cocos2d-js
3+
Cocos2d-JS
44
===========
5-
Cocos2d-JS provides a console tool that makes the development of CH5 and JSB application more simpler and much convenient. You can use it to create a new project, publish it to android, iOS, Mac OS or web, and it's very easy to use.
65

7-
##Setup
6+
Cocos2d-JS is Cocos2d-x engine's javascript version which include Cocos2d-html5 and Cocos2d-x JSBinding. It support full Cocos2d-x features with a set of simplified javascript friendly APIs.
87

9-
First step, you need to setup before using this tool. Please clone Cocos2d-JS repository and update all submodule. Open console in Cocos2d-JS folder, then just run `./setup.py` on console. You may need to provide your NDK, Android SDK and ANT's path during the setup. Note that this tool is developed with python, so you will need python (32bit) 2.7.5 or later installed on your machine (but it doesn't support Python3).
8+
Cocos2d-JS provides a consistent development experience for whichever platform you want to distribute to, both web and native. "Code once, run everywhere" is incredibly easy and natural in Cocos2d-JS. With one single javascript code base, you can run your game on both web browsers and native platform including Mac OS, Windows, iOS, Android. This will bring your game great opportunities in almost all canals of distribution.
109

11-
Some useful links:
10+
Furthermore, javascript friendly API makes your game development experience a breeze, easy to code, test and distribute. Cocos2d-JS also offers Cocos Console, a script tool, to simplify the creation of projects and let you start coding right away. You can use it to create a new project and publish it to android, iOS, Mac OS or web.
1211

13-
* [Android SDK](https://developer.android.com/sdk/index.html?hl=sk)
14-
* [NDK](https://developer.android.com/tools/sdk/ndk/index.html)
15-
* [Ant binary release](http://ant.apache.org/)
16-
- Download Ant.
17-
- Uncompress the downloaded file into a directory.
18-
- Set environmental variables JAVA_HOME to your Java environment, ANT_HOME to the directory you uncompressed Ant to, and add ${ANT_HOME}/bin (Unix) or %ANT_HOME%/bin (Windows) to your PATH.
19-
20-
```
21-
// Example: Execute in console or add into .bash_profile(Mac)
22-
export ANT_HOME=/usr/local/ant
23-
export JAVA_HOME=/usr/local/jdk1.7.0_51
24-
export PATH=${PATH}:${ANT_HOME}/bin
25-
```
12+
## API Reference
2613

27-
##Usage
14+
[Online API reference](http://www.cocos2d-x.org/reference/html5-js/V3.0alpha2/index.html)
2815

29-
After setup correctly done, you can start to use `cocos` command in your console.
16+
And you can download it from
17+
[Cocos2d-html5_v3.0_Alpha2_API_Doc.zip](http://cdn.cocos2d-x.org/Cocos2d-html5_v3.0_Alpha2_API_Doc.zip)
3018

31-
###Create a new project
19+
##How to Start a New Game
3220

33-
* Create a project contains Cocos2d-x JSB and Cocos2d-html5:
21+
1. Download the code from [Cocos2d download site](http://www.cocos2d-x.org/download)
22+
2. Run `setup.py`
23+
3. Run the `cocos` script
3424

35-
```
36-
cocos new projectName -l js
37-
```
25+
Example:
3826

39-
* Create a project contains Cocos2d-html5 only:
27+
$ cd cocos2d-js
28+
$ ./setup.py
29+
$ source FILE_TO_SAVE_SYSTEM_VARIABLE
30+
31+
$ cocos new MyGame -l js -d /directory/to/project
32+
$ cd /directory/to/project/MyGame
33+
34+
4035

41-
```
42-
cocos new projectName -l js --no-native
43-
```
36+
4437

45-
* Create a project in a specified directory:
4638

47-
```
48-
cocos new projectName -l js -d ./Projects
49-
```
5039

51-
###Run the project
40+
###Run the project under the game directory
5241

5342
* Run Cocos2d-html5 project with a Websever:
5443

5544
```
56-
cd directory/to/project
5745
cocos run -p web
5846
```
5947

6048
* Compile and run project in Cocos2d-JSB :
6149

6250
```
63-
cd directory/to/project
6451
cocos compile -p ios|mac|android|web
65-
cocos run -p ios|mac|android
66-
```
67-
68-
* Useful options
69-
70-
```
71-
-p platform : The platform can be ios|mac|android|web.
72-
-s source : Your project directory, if not specified the current directory will be used.
73-
-q : Quiet mode, remove log messages.
74-
-m mode : Mode debug or release, debug is default
75-
--source-map: General source-map file. (Web platform only)
52+
cocos run -p ios|mac|android|web
7653
```
7754

78-
###Help
79-
80-
And if you have any doubt about the usage, please use `-h` with any command to have some help messages. Here are all three commands:
81-
82-
* `new` for create
83-
* `compile` for compile
84-
* `run` for run
55+
You may need to provide your NDK, Android SDK and ANT's path during the setup. Note that this tool is developed with python, so you will need python (32bit) 2.7.5 or later installed on your machine (but it doesn't support Python3). Please refer to [Cocos Console document](http://www.cocos2d-x.org/docs/manual/framework/html5/cocos-console/en).
56+
57+
And if you have any doubt about the usage, please use `-h` with any command to have some help messages.
58+
59+
###Built-in Projects
60+
61+
There are two prebuilt projects in Cocos2d-JS repo:
62+
63+
- Test cases, located in `samples/js-tests`
64+
65+
```
66+
cd samples/js-tests
67+
run -p ios|mac|android|web
68+
```
69+
- Game sample : Moon Warriors, located in `samples/js-moonwarriors`
70+
71+
```
72+
cd samples/js-moonwarriors
73+
run -p ios|mac|android|web
74+
```
75+
And they share the same project file which located in `build` folder, there are Xcode and Visual Studio projects.
76+
77+
Main features
78+
-------------
79+
* Support All modern browsers and native platforms
80+
* Scene management (workflow)
81+
* Transitions between scenes
82+
* Sprites and Sprite Sheets
83+
* Effects: Lens, Ripple, Waves, Liquid, etc.
84+
* Actions (behaviours):
85+
* Trasformation Actions: Move, Rotate, Scale, Fade, Tint, etc.
86+
* Composable actions: Sequence, Spawn, Repeat, Reverse
87+
* Ease Actions: Exp, Sin, Cubic, Elastic, etc.
88+
* Misc actions: CallFunc, OrbitCamera, Follow, Tween
89+
* Basic menus and buttons
90+
* Integrated with physics engines: [Box2d][5] and [Chipmunk][6]
91+
* Particle system
92+
* Skeleton Animations: [Spine][7] and Armature support
93+
* Fonts:
94+
* Fast font rendering using Fixed and Variable width fonts
95+
* Support for .ttf fonts
96+
* Tile Map support: Orthogonal, Isometric and Hexagonal
97+
* Parallax scrolling
98+
* Motion Streak
99+
* Render To Texture
100+
* Touch/Accelerometer on mobile devices
101+
* Touch/Mouse/Keyboard on desktop
102+
* Sound Engine support (CocosDenshion library) based on OpenAL or WebAudio on web
103+
* Integrated Slow motion/Fast forward
104+
* Fast and compressed textures: PVR compressed and uncompressed textures, ETC1 compressed textures, and more
105+
* Resolution Independence
106+
* Modularized engine for customization
107+
* Open Source Commercial Friendly: Compatible with open and closed source projects
108+
* OpenGL ES 2.0 (mobile) / OpenGL 2.1 (desktop) based
109+
* Full WebGL support and auto canvas fallback
110+

0 commit comments

Comments
 (0)