axmol/docs/RELEASE_NOTES.md

402 lines
15 KiB
Markdown
Raw Normal View History

2015-01-15 08:59:03 +08:00
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
2015-12-29 09:48:14 +08:00
- [Cocos2d-x 3.10 Release Notes](#cocos2d-x-
- -release-notes)
2015-01-15 08:59:03 +08:00
- [Misc Information](#misc-information)
- [Requirements](#requirements)
- [Runtime Requirements](#runtime-requirements)
- [Compiler Requirements](#compiler-requirements)
- [How to run tests](#how-to-run-tests)
2015-07-01 18:44:15 +08:00
- [Cocos Console](#cocos-console)
2015-01-15 08:59:03 +08:00
- [Mac OSX & iOS](#mac-osx-&-ios)
- [Android](#android)
- [Windows](#windows)
- [Linux](#linux)
- [How to start a new game](#how-to-start-a-new-game)
2015-12-29 09:48:14 +08:00
- [v3.10](#v310)
2015-12-21 16:56:35 +08:00
- [Highlights features, improvements and API updates of v3.10](#highlights-features-improvements-and-api-updates-of-v310)
- [The main features in detail of Cocos2d-x v3.10:](#the-main-features-in-detail-of-cocos2d-x-v310)
- [UI System](#ui-system)
- [AudioEngine](#audioengine)
2015-08-24 09:40:59 +08:00
- [Others](#others)
- [Other changes](#other-changes)
- [NEW APIS](#new-apis)
2015-01-15 08:59:03 +08:00
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2015-12-21 16:56:35 +08:00
# Cocos2d-x 3.10 Release Notes #
2015-07-01 18:44:15 +08:00
2014-01-07 08:23:06 +08:00
# Misc Information
2015-03-13 17:18:29 +08:00
* [Full Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)
2014-01-07 08:23:06 +08:00
# Requirements
## Runtime Requirements
* Android 2.3 or newer
* iOS 5.0 or newer
* OS X 10.7 or newer
* Windows 7 or newer
2015-04-29 13:39:04 +08:00
* Windows Phone 8.1
2015-08-24 09:40:59 +08:00
* Windows 10 UWP
2014-07-06 20:53:17 +08:00
* Linux Ubuntu 14.04 or newer
2015-07-16 16:53:43 +08:00
* Mordern browsers and IE 9+ (On mobile platforms, only iOS and Android 5 activated WebGL support)
2014-01-07 08:23:06 +08:00
## Compiler Requirements
2014-07-16 11:26:21 +08:00
* Xcode 5.1 or newer for iOS or Mac
2014-07-06 20:53:17 +08:00
* gcc 4.9 or newer for Linux
2014-11-29 13:20:21 +08:00
* ndk-r10c for Android
2015-07-15 14:11:59 +08:00
* Visual Studio 2013 or newer for Windows (win32)
2015-08-12 13:02:35 +08:00
* Visual Studio 2013 update4 or newer for Windows 8.1 universal Apps
* Visual Studio 2015 RC or newer and Windows 10.0 (build 10074 or higher) for Windows 10.0 UWP Apps
2014-01-07 08:23:06 +08:00
2014-04-21 14:50:27 +08:00
## How to run tests
2014-03-04 18:15:30 +08:00
2015-07-01 18:44:15 +08:00
### Cocos Console
You can use [Cocos Console](www.cocos2d-x.org/wiki/Cocos2d-console) command line tool to run the test cases on almost all supported platforms.
In console application:
```
// Enter cpp test folder
2015-07-14 08:44:44 +08:00
cd tests/cpp-tests
2015-07-01 18:44:15 +08:00
// Or enter js test folder
2015-07-14 08:44:44 +08:00
cd tests/js-tests
2015-07-01 18:44:15 +08:00
// Or enter lua test folder
cd tests/lua-tests
// Compile or run test case
cocos compile -p ios|mac|android|win32|win8_1|metro|web -m debug|release
cocos run -p ios|mac|android|win32|win8_1|metro|web -m debug|release
```
For example, if you want to run cpp test in release mode on Android, you can use the following command:
```
cocos run -p android -m release
```
2014-03-04 18:15:30 +08:00
### Mac OSX & iOS
2015-08-24 09:40:59 +08:00
* Enter `cocos2d-x/build` folder, open `cocos2d_test.xcodeproj`
* Select `cpp-tests`, `lua-tests`, `js-tests` for `iOS` or `OS X` target in scheme toolbar
2014-03-04 18:15:30 +08:00
* Click `run` button
### Android
2014-03-07 08:37:33 +08:00
You can run the samples...
2014-03-04 18:15:30 +08:00
2014-03-07 08:37:33 +08:00
**Using command line:**
2014-03-04 18:15:30 +08:00
2015-01-06 09:55:44 +08:00
$ cd cocos2d-x
$ ./setup.py
$ cd build
$ ./android-build.py cpp-empty-test -p 10
$ adb install cocos2d-x/tests/cpp-empty-test/proj.android/bin/CppEmptyTest-debug.apk
2015-01-15 06:51:42 +08:00
2014-03-04 18:15:30 +08:00
Then click item on Android device to run tests. Available value of `-p` is the API level, cocos2d-x supports from level 10.
2014-03-07 08:37:33 +08:00
**Using Eclipse:**
2014-03-04 18:15:30 +08:00
2015-01-06 09:55:44 +08:00
$ cd cocos2d-x
$ ./setup.py
$ cd build
$ ./android-build.py cpp-empty-test -p 10
2015-01-15 06:51:42 +08:00
2014-03-04 18:15:30 +08:00
Then
* Import cocos2d-x Android project into Eclipse, the path used to import is `cocos/2d/platform/android`
2014-03-14 15:01:11 +08:00
* Import `cpp-empty-test` Android project into Eclipse, the path used to import is `tests/cpp-empty-test/proj.android`
* Build `cpp-empty-test` Android project and run
2014-03-04 18:15:30 +08:00
### Windows
2015-08-24 09:40:59 +08:00
* For win32 project, enter `cocos2d-x/build`, and open `cocos2d-win32.sln`
* For win 8.1 project, enter `cocos2d-x/build`, and open `cocos2d-win8.1-universal.sln`
2015-08-12 13:02:35 +08:00
* For win 10 project, enter `cocos2d-x/build`, and open `cocos2d-win10.sln`
2015-07-01 18:44:15 +08:00
* Select running target
2014-03-04 18:15:30 +08:00
* Click run button
### Linux
2015-01-06 09:55:44 +08:00
$ cd cocos2d-x/build
$ ./install-deps-linux.sh
$ cd ../..
2015-01-15 06:51:42 +08:00
2014-03-04 18:15:30 +08:00
Then
2015-01-06 09:55:44 +08:00
$ mkdir build
$ cd build
$ cmake ../cocos2d-x
$ make -j4
2015-01-15 06:51:42 +08:00
2014-03-04 18:15:30 +08:00
Run
2015-01-06 09:55:44 +08:00
$ cd bin/cpp-empty-test
$ ./cpp-empty-test
2015-01-15 06:51:42 +08:00
2014-03-06 14:44:33 +08:00
## How to start a new game
2015-07-01 18:44:15 +08:00
Use Cocos Console to create a new game:
2014-12-31 18:15:27 +08:00
```
2015-08-24 09:40:59 +08:00
cocos new -l cpp|js|lua MyNewGame
```
2015-03-13 15:08:09 +08:00
2015-12-21 16:56:35 +08:00
# v3.10
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
## Highlights features, improvements and API updates of v3.10
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
We are happy to announce the release of Cocos2d-x v3.10. Following are the highlighted features, improvements and API updates in this version.
2015-08-24 09:40:59 +08:00
2016-01-06 09:50:00 +08:00
1. Provides a unified setup for both Cocos2d-x and Cocos. This allows you to stay up to date with the latest Cocos2d-x releases. This includes using precompiled binaries and source code, in a single place. As always the source code is available from [GitHub](https://github.com/cocos2d/cocos2d-x) but, there is no longer a `.zip` file available containing the source code.
2. New __Cocos Launcher__ tool! __Cocos Launcher__ allows:
* One step to create a new project with the engine, by using precompiled libraries or source code.
2016-01-05 10:52:03 +08:00
* Easy integration with SDKBOX for 3rd party services: Facebook, IAP and many more.
2016-01-06 09:50:00 +08:00
* Developers to provide feedback and get support, directly within __Cocos Launcher__, making it simple to contact the engine team for help. 
2016-01-05 10:23:52 +08:00
3. UI System:
2016-01-06 09:50:00 +08:00
* Reimplemented `Scale9Sprite` to improve performance and reduce memory consumption.
* Changed `PageView` to derive from `ListView`. `PageView` can add any widget as a child.
* Added three new *overflow types* to `Label`: **CLAMP****SHRINK**, **RESIZE_HEIGHT**.
* Fixed a bug in `ClippingNode` that corrects its behavior when being set as a child.
4. Improved **JavaScript Bindings**: follows [SpiderMonkey GC best practices](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide) making it more robust.
2015-03-13 15:08:09 +08:00
2015-12-21 16:56:35 +08:00
## The main features in detail of Cocos2d-x v3.10:
2015-01-06 09:51:17 +08:00
2015-12-21 16:56:35 +08:00
### UI System
2016-01-05 10:27:06 +08:00
1. Reimplemented `Scale9Sprite` and improve the scale9sprite performance and reduce memory consumption.
2015-12-25 18:58:31 +08:00
Reimplemented ui::Scale9Sprite, now the Slice sprite uses 16 vertices and 54 indices instead of the old 9 sprites way, The memory consumption is much lower than the previous implementation, and it is also more efficient.
In SIMPLE mode, the 4 borders are all 0 and the whole sprite will scale horizontally and vertically. In this mode only 1 quad is used for rendering, for example:
2015-12-25 18:58:31 +08:00
auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png");
//When setting to SIMPLE, only 4 vertexes is used to rendering.
blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE);
In SLICE mode, it will use 18 triangles to rendering the slice 9 sprite. If the 4 borders are 0, there still be 18 triangles computed. So choose your RenderingType wisely, for example:
2015-12-25 18:58:31 +08:00
auto sprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png");
//When setting to SLICE, 16 vertexes will be used to rendering.
sprite->setRenderingType(Scale9Sprite::RenderingType::SLICE);
2016-01-05 10:27:06 +08:00
2. Changed `PageView` to derived from ListView, PageView can add any type of widget as child.
2015-11-06 21:08:47 +08:00
PageView was derived from Layout and it implemented the features of scrolling and item arrangement from scratch. But the features are already there in ListView. So remove those duplicated implementations from PageView and make it inherit from ListView.
By consequence, PageView becomes simpler and easier to maintain because it considers only paging implementation. for example:
2015-12-25 18:58:31 +08:00
// Create the page view
Size size(240, 130);
PageView* pageView = PageView::create();
pageView->setDirection(PageView::Direction::HORIZONTAL);
pageView->setContentSize(size);
Size backgroundSize = background->getContentSize();
//"removeAllPages" is changed to "removeAllItems"
pageView->removeAllItems();
pageView->setIndicatorEnabled(true);
2015-12-25 18:58:31 +08:00
int pageCount = 4;
for (int i = 0; i < pageCount; ++i)
2015-12-21 16:56:35 +08:00
{
2015-12-25 18:58:31 +08:00
Layout* layout = Layout::create();
layout->setContentSize(size);
ImageView* imageView = ImageView::create("cocosui/scrollviewbg.png");
imageView->setScale9Enabled(true);
imageView->setContentSize(size);
imageView->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f));
layout->addChild(imageView);
Text* label = Text::create(StringUtils::format("page %d",(i+1)), "fonts/Marker Felt.ttf", 30);
label->setColor(Color3B(192, 192, 192));
label->setPosition(Vec2(layout->getContentSize().width / 2.0f, layout->getContentSize().height / 2.0f));
layout->addChild(label);
//"insertPage" is changed to "insertCustomItem"
pageView->insertCustomItem(layout, i);
}
//"removePageAtIndex" is changed to "removeItem"
pageView->removeItem(0);
//"scrollToPage" is changed to "scrollToItem"
pageView->scrollToItem(pageCount - 2);
More detail usage please refer to: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp.
2015-12-21 16:56:35 +08:00
2015-12-25 18:58:31 +08:00
3. Added three overflow type to new label: CLAMP, SHRINK, RESIZE_HEIGHT.
Overflow type is used to control label overflow result, In SHRINK mode, the font size will change dynamically to adapt the content size. In CLAMP mode, when label content goes out of the bounding box, it will be clipped, In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically. For example:
2015-12-25 18:58:31 +08:00
//Change the label's Overflow type
label->setOverflow(Label::Overflow::RESIZE_HEIGHT);
2015-04-07 15:59:40 +08:00
2015-12-25 18:58:31 +08:00
More detail usage please refer to: tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp.
2015-04-22 14:59:22 +08:00
2015-12-25 18:58:31 +08:00
Limitations:
currently only TTF and BMFont support all the valid Overflow type. Char Map font supports all the Overflow type except for SHRINK, because we can't measure its font size. System font only support Overflow::Normal and Overflow::RESIZE_HEIGHT.
2015-04-22 14:59:22 +08:00
## Other changes
2015-12-25 18:58:31 +08:00
[NEW] RichText supported new line element.
2015-12-21 16:56:35 +08:00
[NEW] UIText::clone supports clone the text effect.
[NEW] UI: Added methods to query label effect state.
[REFINE] IOS: Added virtual keyword for some render related function.
2015-04-22 14:59:22 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] UI: Fixed boring deprecated warning in HttpRequest.
2015-04-22 14:59:22 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Network: Fixed Downloader bug on iOS & Android platform.
2015-04-22 14:59:22 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Studio: Fixed deprecation warning in SkeletonRenderer.
2015-04-22 14:59:22 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] JS: Added js test case for fix, improve template.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Network: Permit http access to cocos2d-x.org in test projects on iOS.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Network: Crash when removing a remotely downloaded image from texture
cache in js-binding.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Win10: WinRT project update version to v3.10.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Console: Added quiet option for Cocos Toolkit.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] JS: New GC model for js-binding.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Doc: Fixed typos in documentation and comments.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] UI: Updated controlButton size calculate with new Scale9Sprite logic.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] Win10: Added missing _USRJSSTATIC preprocessor define for ARM builds.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] JS: Added ccvector_to / ccmap_to converted to new js-binding API.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[REFINE] UI: Slider misprint fix.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Core: Fixed premultiplyAlpha for mipmaps and compressed textures.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed Scale9sprite rendering error when content size smaller than the sum of leftInset and rightInset.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Win32: Fixed EditBox crash when removing an EditBox in a scheduler.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Android: Fixed cannot add view to mFrameLayout when extends Cocos2dxActivity.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] 2D: Fixed actionNode set at wrong position bug.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] 3D: Fixed the movement of PUParticle lags one frame.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed the wront argument of setPlaceholderFontName in EditBox.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed EditBox editBoxEditingDidEnd may use the original text after change the text of EditBox in user script.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Audio: Fixed `FinishCallback` never be called in Windows.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed Layout stencil clipping nested with Clipping Node rendering issue.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Keyboard doesn't hide when click the screen outside of EditBox on iOS platform.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed a fatal bug in EditBox implement on Windows platform.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed edit box setPlaceholderFontName and scale font size issue.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Core: Fixed memory leak when initWithImage() failed.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Network: CCDownloader on iOS is broken in v3.9 js-binding.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] JS: Bindings fixes for Menu, Sprite and Label.
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
[FIX] Studio: Removed weak reference in ActionNode.
2015-12-21 16:56:35 +08:00
[FIX] UI: shouldStartLoading method should return value to js in js-binding.
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed scrollview render error.
2015-12-21 16:56:35 +08:00
[FIX] JS: Fixed win32 js project crash issue.
2015-12-21 16:56:35 +08:00
[FIX] UI: Button touch doesn't work with scale9 enabled.
2015-12-21 16:56:35 +08:00
[FIX] JS: Fixed evalString doesn't return result issue.
2015-12-21 16:56:35 +08:00
[FIX] JS: Fixed ComponentJS proxy management issue in JSB.
2015-12-21 16:56:35 +08:00
[FIX] Android: Fixed include in cocos network module.
2015-12-21 16:56:35 +08:00
[FIX] Network: Fixed web socket crash.
2015-12-21 16:56:35 +08:00
[FIX] UI: Fixed TextField missing default password style text setting.
2015-12-21 16:56:35 +08:00
[TEST] S9SpriteTest: Scale9Sprite fade actions with cascade opacity.
2015-12-21 16:56:35 +08:00
[TEST] Web: Removed default focus block from UIFocusTestVertical.
2015-12-21 16:56:35 +08:00
[TEST] Lua: Fixed pageViewTest Horizontal scroll won't work in Lua-test.
You can also take a look at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG).
## NEW APIS
2015-12-21 16:56:35 +08:00
1. RichText
Added RichElementNewLine class to create new RichText Element.
For more information: [https://github.com/cocos2d/cocos2d-x/pull/14033](https://github.com/cocos2d/cocos2d-x/pull/14033 "https://github.com/cocos2d/cocos2d-x/pull/14033")
2. PageViewIndicator
Added PageViewIndicator class to create PageViewIndicator.
For more information: [https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h](https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h "https://github.com/cocos2d/cocos2d-x/blob/v3/cocos/ui/UIPageViewIndicator.h")
3. PageView
Changed PageView to derived from ListView.
For more information: [https://github.com/cocos2d/cocos2d-x/pull/14252](https://github.com/cocos2d/cocos2d-x/pull/14252 "https://github.com/cocos2d/cocos2d-x/pull/14252")
4. ApplicationProtocol
Added the API getVersion.
5. PolygonInfo
Added the API setTriangles.
6. Scale9Sprite
2015-12-25 18:58:31 +08:00
Added setRenderingType, getRenderingType.
2015-12-21 16:56:35 +08:00
9. FontFNT
2015-12-21 16:56:35 +08:00
Added setFontSize, getOriginalFontSize.
2015-12-21 16:56:35 +08:00
10. Label
2015-12-25 18:58:31 +08:00
Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor.
2015-12-21 16:56:35 +08:00
11. AudioEngineImpl
2015-12-21 16:56:35 +08:00
Added AudioEngineImpl to implement FMOD.
12. Lua Module
Added luaval_to_node, node_to_luaval.
13. JS Module
Added js_cocos2dx_ComponentJS_create
2015-12-25 18:58:31 +08:00
14. ui::Text
2015-12-21 16:56:35 +08:00
Added isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor.
2015-12-21 16:56:35 +08:00
15. UITextTest_Clone
2015-08-24 09:40:59 +08:00
2015-12-21 16:56:35 +08:00
Added UITextTest_Clone class.