背景和头像缺失
This commit is contained in:
3
cocos2d/docs/.gitignore
vendored
Normal file
3
cocos2d/docs/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
html/
|
||||
.tee-*.txt
|
||||
|
||||
2849
cocos2d/docs/CODING_STYLE.md
Normal file
2849
cocos2d/docs/CODING_STYLE.md
Normal file
File diff suppressed because it is too large
Load Diff
15
cocos2d/docs/Groups.h
Normal file
15
cocos2d/docs/Groups.h
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
@defgroup _2d 2D Nodes
|
||||
@defgroup _3d 3D Nodes
|
||||
@defgroup actions Actions
|
||||
@defgroup audio Audio
|
||||
@defgroup base Base
|
||||
@defgroup network Network
|
||||
@defgroup physics Physics
|
||||
@defgroup physics_2d Physics 2D
|
||||
@defgroup platform Platform Specific
|
||||
@defgroup renderer Renderer
|
||||
@defgroup storage Storage
|
||||
@defgroup ui UI Nodes
|
||||
@defgroup lua Lua Binding
|
||||
*/
|
||||
59
cocos2d/docs/MainPage.h
Normal file
59
cocos2d/docs/MainPage.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*!
|
||||
@cond GEN_REFERENCE_BOOK
|
||||
|
||||
@mainpage cocos2d-x
|
||||
|
||||
@image html cocos2dx_portrait.png
|
||||
|
||||
@section sec1 About cocos2d-x
|
||||
cocos2d-x open source project is designed to be a cross-platform 2D game engine for building 2D games, demos and other graphical/interactive mobile applications.
|
||||
It runs on top of OpenGL 2.0 and OpenGL ES 2.0 and is written in C++.\n
|
||||
This project is based on the famous <A HREF="http://www.cocos2d-iphone.org">"cocos2d-iphone"</A> project.\n
|
||||
|
||||
- website: http://www.cocos2d-x.org/
|
||||
- forum: http://forum.cocos2d-x.org/
|
||||
- twitter: http://twitter.com/cocos2dx/
|
||||
- weibo: http://weibo.com/cocos2dx/
|
||||
- wiki: http://wiki.cocos2d-x.org/
|
||||
- show cases: http://www.cocos2d-x.org/games
|
||||
|
||||
- <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Tutorials">Tutorials of Cocos2dxSimpleGame</A>
|
||||
- <A HREF="http://www.cocos2d-x.org/projects/cocos2d-x/wiki/Installation_and_First_run">Installation and First run</A>
|
||||
- <A HREF="http://www.cocos2d-x.org/boards/6/topics/567">FAQ</A>
|
||||
|
||||
\n
|
||||
|
||||
@section sec2 License
|
||||
Copyright (c) 2010-2012 cocos2d-x.org \n
|
||||
\n
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy \n
|
||||
of this software and associated documentation files (the "Software"), to deal \n
|
||||
in the Software without restriction, including without limitation the rights \n
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell \n
|
||||
copies of the Software, and to permit persons to whom the Software is \n
|
||||
furnished to do so, subject to the following conditions: \n
|
||||
\n
|
||||
The above copyright notice and this permission notice shall be included in \n
|
||||
all copies or substantial portions of the Software. \n
|
||||
\n
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \n
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \n
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \n
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \n
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \n
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \n
|
||||
THE SOFTWARE. \n
|
||||
\n
|
||||
|
||||
@section sec3 Get the source code
|
||||
- Stable version: \n
|
||||
- publish at http://download.cocos2d-x.org/
|
||||
- Latest code: \n
|
||||
- http://github.com/cocos2d/cocos2d-x/
|
||||
|
||||
@section sec4 How to contribute
|
||||
- Fork our repository on github, commit your changes, and send a "pull request" to us. We will merge your contribution to master
|
||||
- Suggestion, bug fixes, and improvements are highly appreciated.
|
||||
|
||||
@endcond
|
||||
*/
|
||||
16
cocos2d/docs/MainPageWhiteBook.h
Normal file
16
cocos2d/docs/MainPageWhiteBook.h
Normal file
@@ -0,0 +1,16 @@
|
||||
/*!
|
||||
@cond GEN_WRITE_BOOK
|
||||
|
||||
@mainpage cocos
|
||||
|
||||
@image html img-cocos.jpg
|
||||
|
||||
@section sec1 About cocos
|
||||
Cocos is a complete game development toolkit that enables game developers to quickly build games all the way from prototyping to full fledged game.
|
||||
|
||||
Cocos combines the best ingredients from the Cocos2d community. It includes an all purpose game editor, a coding IDE, and even a marketplace for the community to find and share 3rd-party extensions and tools. All for the purpose of making game development process a breeze.
|
||||
|
||||
Cocos is maintained and copyrighted by Chukong Technologies.
|
||||
|
||||
@endcond
|
||||
*/
|
||||
171
cocos2d/docs/RELEASE_ENGINEERING.md
Normal file
171
cocos2d/docs/RELEASE_ENGINEERING.md
Normal file
@@ -0,0 +1,171 @@
|
||||
# Cocos2d-x Release Engineering
|
||||
|
||||
|
||||
## Tagging
|
||||
|
||||
New releases must be tagged in github. The tag name must follow these rules:
|
||||
|
||||
cocos2d-x-Major.Minor[.Status]
|
||||
|
||||
or
|
||||
|
||||
cocos2d-x-Major.Minor.Revision[.Status]
|
||||
|
||||
Example of valid names:
|
||||
|
||||
* cocos2d-x-3.0rc0
|
||||
* cocos2d-x-3.0
|
||||
* cocos2d-x-2.1.1
|
||||
* cocos2d-x-2.1.1rc0
|
||||
|
||||
See "Naming Conventions" below
|
||||
|
||||
## Branching
|
||||
|
||||
Each Major version will have 2 branches, `master` and `develop`.
|
||||
For cocos2d-x v3, the branches names will be `v3-master` and `v3-develop`, for v4 the branches names will be `v4-master` and `v4-develop`, and so on.
|
||||
|
||||
* `master` is the stable branch.
|
||||
* `develop` is the unstable branch. All new features, bug fixes, etc, are applied first to `develop`.
|
||||
|
||||
Once a new version is released (either Major, Minor or Revision), then `develop` branch must be merged into `master` branch. To be more specific, `master` only contains _stable_ releases. _Alpha_, _Beta_, and _RC_ versions MUST NOT be merged into `master`.
|
||||
|
||||
|
||||
## Announcing
|
||||
|
||||
Only stable releases must be announced on:
|
||||
|
||||
* [Blog](http://www.cocos2d-x.org/news)
|
||||
|
||||
All kind of releases (alpha,beta,rc, final) must be announced on:
|
||||
* [Twitter](https://twitter.com/cocos2dx)
|
||||
* [Forum](http://discuss.cocos2d-x.org/)
|
||||
|
||||
|
||||
## Download package
|
||||
|
||||
A download package must be available for each released version.
|
||||
The package shall include the source code of cocos2d-x, and the needed scripts to download and install the 3rd party binaries.
|
||||
|
||||
|
||||
## Release Notes and Changelog
|
||||
|
||||
**BEFORE** releasing a new version (either stable or unstable), the following documents must be updated:
|
||||
|
||||
* [CHANGELOG](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)
|
||||
* [Release Notes](https://github.com/cocos2d/cocos2d-x/blob/v3/docs/RELEASE_NOTES.md)
|
||||
|
||||
## Documentation
|
||||
|
||||
**BEFORE** releasing a new Minor or Major stable release, the following tasks MUST be done:
|
||||
|
||||
- All documentation MUST be updated to the new version. This includes:
|
||||
- API Reference
|
||||
- Programmers Guide
|
||||
|
||||
## Backward compatibility
|
||||
|
||||
- Minor versions MUST be backward compatible with previous minor versions. eg: v3.2 must be backward compatible with v3.1 and v3.0.
|
||||
- Major versions SHOULD be backward compatible with previous major versions. Breaking backward compatibility in Major versions is acceptable only if it is extremely well justified
|
||||
|
||||
## Deprecated APIs
|
||||
|
||||
- Only Major versions (eg: 4.0, 5.0) can introduce deprecated APIs. Deprecated APIs cannot be introduced in Point releases (eg: 3.5, 4.2).
|
||||
- Only Major versions can remove deprecated APIs. They cannot be removed in Point versions.
|
||||
- A deprecated API must live at least for the whole cycle of a Major version. Eg: if an API was deprecated in 4.0, it can be removed in 5.0, but not before. It can be removed in 6.0 or future Major releases, but it cannot be removed in Point releases, like 5.1.
|
||||
|
||||
|
||||
## Performance tests
|
||||
|
||||
- Performance tests MUST be run before releasing a Release Candidate
|
||||
- If performance is worse than previous stable version, then the Release Candidate MUST NOT be released (See Naming Conventions below)
|
||||
- Results of the performance tests must be documented in this [spreadsheet](https://docs.google.com/spreadsheet/ccc?key=0AvvkdgVbWvpZdHFudzdDT3NuYTRNTHlZZzRGZWYzMmc#gid=8)
|
||||
|
||||
|
||||
## Samples and tests
|
||||
|
||||
**BEFORE** releasing a new Minor or Major stable release, the following tasks MUST be done:
|
||||
|
||||
- All the samples and tests must be updated to use the new version. This includes:
|
||||
- The samples in [cocos2d-x-samples](https://github.com/cocos2d/cocos2d-x-samples) repository
|
||||
- The demo games [EarthWarrior3D](https://github.com/chukong/EarthWarrior3D) and [FantasyWarrior3D](https://github.com/chukong/FantasyWarrior3D)
|
||||
- All the tests bundled in cocos2d-x
|
||||
- All the templates bundled in cocos2d-x
|
||||
|
||||
## Naming conventions
|
||||
|
||||
### Alpha
|
||||
|
||||
The product is unstable. It could have memory leaks, or crashes, or the API is unstable. The product contains little QA.
|
||||
Although the product is not ready for production, the product should be testable.
|
||||
Alpha versions might have Core functionality that has just been refactored, meaning that Core functionality might be unstable, but should work Ok.
|
||||
|
||||
As an example, for cocos2d-x, an _Alpha_ version means:
|
||||
|
||||
* Basic functionality works Ok (not great, but OK), like Sprites, Scenes, actions, etc.
|
||||
_* But it might have memory leaks, or crashes, or the recently added features might be unfinished. The documentation might not be updated.
|
||||
* As an example, the Renderer refactoring must be done in "alpha" versions (but not Beta versions).
|
||||
|
||||
Alpha versions are NOT feature freeze. New features might be added in future alpha and beta versions.
|
||||
|
||||
### Beta
|
||||
|
||||
The product is more stable than _Alpha_. The product might crash, but not frequently. No major changes were made in core components.
|
||||
Smaller features could be refactored in _Beta_ versions, but the core functionality is stable.
|
||||
The product has more QA.
|
||||
The only difference between _Alpha_ and _Beta_, is that _Beta_ is more stable than _Alpha_. And that in _Beta_ versions no new major features will be added.
|
||||
|
||||
As an example, for cocos2d-x it means:
|
||||
|
||||
* All the Core features (Sprites, Menu, Labels, Director, Transitions) are stable. Bug fixes could have been added into the Core functionality, but no major refactoring were done in the Core.
|
||||
* But perhaps new features like the new Particle Engine could be unfinished, or the Cocos Studio reader might crash.
|
||||
* Some cocos2d-x users might want to use a beta version for real games.
|
||||
|
||||
Beta versions are NOT feature freeze. __Small__ new features might be added in future _Beta_ versions. New __BIG__ features that might affect the Core functionality must only be added in _Alpha_ versions, and not in _Beta_ versions.
|
||||
|
||||
|
||||
### Release Candidate
|
||||
Release candidate means that, unless major bugs are found, the product is ready for release.
|
||||
The difference between _Release Candidate__ and _Final_ is that RC has less testing than the final version.
|
||||
|
||||
Many cocos2d-x users might want to try and use the RC releases for production.
|
||||
|
||||
RC versions ARE feature freeze. No new features, no matter how small they are, MUST be added in RC versions, because as the name implies, it is a _Release Candiate_.
|
||||
|
||||
|
||||
### Final
|
||||
|
||||
It is the new stable version.
|
||||
|
||||
## Number conventions
|
||||
|
||||
major.minor [revision | status]
|
||||
|
||||
### Major
|
||||
The major number is increased when there are significant jumps in functionality such as changing the framework which could cause incompatibility with interfacing systems
|
||||
|
||||
### Minor
|
||||
The minor number is incremented when only minor features or significant fixes have been added.
|
||||
|
||||
### Revision
|
||||
The revision number is incremented when minor bugs are fixed.
|
||||
|
||||
### Status
|
||||
The status could be: alphaN, betaN or rcN.
|
||||
|
||||
'N' is a number, and the first MUST always be 0.
|
||||
|
||||
### Examples
|
||||
|
||||
v2.0-alpha0:
|
||||
- New major version of cocos2d-x.
|
||||
- Unstable
|
||||
|
||||
v2.1.3:
|
||||
- Stable version of cocos2d-x. It is the same as v2.1 plus some bug fixes.
|
||||
|
||||
v2.2-beta0:
|
||||
- Similar to v2.1.3, but some new features were added, but are not stable yet.
|
||||
|
||||
v2.2:
|
||||
- Similar to v2.1.3, but some small features were added. The new features are stable.
|
||||
402
cocos2d/docs/RELEASE_NOTES.md
Normal file
402
cocos2d/docs/RELEASE_NOTES.md
Normal file
@@ -0,0 +1,402 @@
|
||||
<!-- 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)*
|
||||
|
||||
- [Cocos2d-x 3.10 Release Notes](#cocos2d-x-
|
||||
- -release-notes)
|
||||
- [Misc Information](#misc-information)
|
||||
- [Requirements](#requirements)
|
||||
- [Runtime Requirements](#runtime-requirements)
|
||||
- [Compiler Requirements](#compiler-requirements)
|
||||
- [How to run tests](#how-to-run-tests)
|
||||
- [Cocos Console](#cocos-console)
|
||||
- [Mac OSX & iOS](#mac-osx-&-ios)
|
||||
- [Android](#android)
|
||||
- [Windows](#windows)
|
||||
- [Linux](#linux)
|
||||
- [How to start a new game](#how-to-start-a-new-game)
|
||||
- [v3.10](#v310)
|
||||
- [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)
|
||||
- [Others](#others)
|
||||
- [Other changes](#other-changes)
|
||||
- [NEW APIS](#new-apis)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
# Cocos2d-x 3.10 Release Notes #
|
||||
|
||||
# Misc Information
|
||||
|
||||
* [Full Changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG)
|
||||
|
||||
# Requirements
|
||||
|
||||
## Runtime Requirements
|
||||
|
||||
* Android 2.3 or newer
|
||||
* iOS 5.0 or newer
|
||||
* OS X 10.7 or newer
|
||||
* Windows 7 or newer
|
||||
* Windows Phone 8.1
|
||||
* Windows 10 UWP
|
||||
* Linux Ubuntu 14.04 or newer
|
||||
* Mordern browsers and IE 9+ (On mobile platforms, only iOS and Android 5 activated WebGL support)
|
||||
|
||||
## Compiler Requirements
|
||||
|
||||
* Xcode 5.1 or newer for iOS or Mac
|
||||
* gcc 4.9 or newer for Linux
|
||||
* ndk-r10c for Android
|
||||
* Visual Studio 2013 or newer for Windows (win32)
|
||||
* 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
|
||||
|
||||
## How to run tests
|
||||
|
||||
### 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
|
||||
cd tests/cpp-tests
|
||||
// Or enter js test folder
|
||||
cd tests/js-tests
|
||||
// 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
|
||||
```
|
||||
|
||||
### Mac OSX & iOS
|
||||
|
||||
* 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
|
||||
* Click `run` button
|
||||
|
||||
### Android
|
||||
|
||||
You can run the samples...
|
||||
|
||||
**Using command line:**
|
||||
|
||||
$ 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
|
||||
|
||||
Then click item on Android device to run tests. Available value of `-p` is the API level, cocos2d-x supports from level 10.
|
||||
|
||||
**Using Eclipse:**
|
||||
|
||||
$ cd cocos2d-x
|
||||
$ ./setup.py
|
||||
$ cd build
|
||||
$ ./android-build.py cpp-empty-test -p 10
|
||||
|
||||
Then
|
||||
|
||||
* Import cocos2d-x Android project into Eclipse, the path used to import is `cocos/2d/platform/android`
|
||||
* 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
|
||||
|
||||
### Windows
|
||||
|
||||
* 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`
|
||||
* For win 10 project, enter `cocos2d-x/build`, and open `cocos2d-win10.sln`
|
||||
* Select running target
|
||||
* Click run button
|
||||
|
||||
### Linux
|
||||
|
||||
$ cd cocos2d-x/build
|
||||
$ ./install-deps-linux.sh
|
||||
$ cd ../..
|
||||
|
||||
Then
|
||||
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ cmake ../cocos2d-x
|
||||
$ make -j4
|
||||
|
||||
Run
|
||||
|
||||
$ cd bin/cpp-empty-test
|
||||
$ ./cpp-empty-test
|
||||
|
||||
## How to start a new game
|
||||
|
||||
Use Cocos Console to create a new game:
|
||||
|
||||
```
|
||||
cocos new -l cpp|js|lua MyNewGame
|
||||
```
|
||||
|
||||
# v3.10
|
||||
|
||||
## Highlights features, improvements and API updates of v3.10
|
||||
|
||||
We are happy to announce the release of Cocos2d-x v3.10. Following are the highlighted features, improvements and API updates in this version.
|
||||
|
||||
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.
|
||||
* Easy integration with SDKBOX for 3rd party services: Facebook, IAP and many more.
|
||||
* Developers to provide feedback and get support, directly within __Cocos Launcher__, making it simple to contact the engine team for help.
|
||||
3. UI System:
|
||||
* 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.
|
||||
|
||||
## The main features in detail of Cocos2d-x v3.10:
|
||||
|
||||
### UI System
|
||||
|
||||
1. Reimplemented `Scale9Sprite` and improve the scale9sprite performance and reduce memory consumption.
|
||||
|
||||
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:
|
||||
|
||||
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:
|
||||
|
||||
auto sprite = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png");
|
||||
//When setting to SLICE, 16 vertexes will be used to rendering.
|
||||
sprite->setRenderingType(Scale9Sprite::RenderingType::SLICE);
|
||||
|
||||
2. Changed `PageView` to derived from ListView, PageView can add any type of widget as child.
|
||||
|
||||
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:
|
||||
|
||||
// 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);
|
||||
|
||||
int pageCount = 4;
|
||||
for (int i = 0; i < pageCount; ++i)
|
||||
{
|
||||
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.
|
||||
|
||||
|
||||
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:
|
||||
|
||||
//Change the label's Overflow type
|
||||
label->setOverflow(Label::Overflow::RESIZE_HEIGHT);
|
||||
|
||||
More detail usage please refer to: tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp.
|
||||
|
||||
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.
|
||||
|
||||
## Other changes
|
||||
[NEW] RichText supported new line element.
|
||||
|
||||
[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.
|
||||
|
||||
[REFINE] UI: Fixed boring deprecated warning in HttpRequest.
|
||||
|
||||
[REFINE] Network: Fixed Downloader bug on iOS & Android platform.
|
||||
|
||||
[REFINE] Studio: Fixed deprecation warning in SkeletonRenderer.
|
||||
|
||||
[REFINE] JS: Added js test case for fix, improve template.
|
||||
|
||||
[REFINE] Network: Permit http access to cocos2d-x.org in test projects on iOS.
|
||||
|
||||
[REFINE] Network: Crash when removing a remotely downloaded image from texture
|
||||
cache in js-binding.
|
||||
|
||||
[REFINE] Win10: WinRT project update version to v3.10.
|
||||
|
||||
[REFINE] Console: Added quiet option for Cocos Toolkit.
|
||||
|
||||
[REFINE] JS: New GC model for js-binding.
|
||||
|
||||
[REFINE] Doc: Fixed typos in documentation and comments.
|
||||
|
||||
[REFINE] UI: Updated controlButton size calculate with new Scale9Sprite logic.
|
||||
|
||||
[REFINE] Win10: Added missing _USRJSSTATIC preprocessor define for ARM builds.
|
||||
|
||||
[REFINE] JS: Added ccvector_to / ccmap_to converted to new js-binding API.
|
||||
|
||||
[REFINE] UI: Slider misprint fix.
|
||||
|
||||
[FIX] Core: Fixed premultiplyAlpha for mipmaps and compressed textures.
|
||||
|
||||
[FIX] UI: Fixed Scale9sprite rendering error when content size smaller than the sum of leftInset and rightInset.
|
||||
|
||||
[FIX] Win32: Fixed EditBox crash when removing an EditBox in a scheduler.
|
||||
|
||||
[FIX] Android: Fixed cannot add view to mFrameLayout when extends Cocos2dxActivity.
|
||||
|
||||
[FIX] 2D: Fixed actionNode set at wrong position bug.
|
||||
|
||||
[FIX] 3D: Fixed the movement of PUParticle lags one frame.
|
||||
|
||||
[FIX] UI: Fixed the wront argument of setPlaceholderFontName in EditBox.
|
||||
|
||||
[FIX] UI: Fixed EditBox editBoxEditingDidEnd may use the original text after change the text of EditBox in user script.
|
||||
|
||||
[FIX] Audio: Fixed `FinishCallback` never be called in Windows.
|
||||
|
||||
[FIX] UI: Fixed Layout stencil clipping nested with Clipping Node rendering issue.
|
||||
|
||||
[FIX] UI: Keyboard doesn't hide when click the screen outside of EditBox on iOS platform.
|
||||
|
||||
[FIX] UI: Fixed a fatal bug in EditBox implement on Windows platform.
|
||||
|
||||
[FIX] UI: Fixed edit box setPlaceholderFontName and scale font size issue.
|
||||
|
||||
[FIX] Core: Fixed memory leak when initWithImage() failed.
|
||||
|
||||
[FIX] Network: CCDownloader on iOS is broken in v3.9 js-binding.
|
||||
|
||||
[FIX] JS: Bindings fixes for Menu, Sprite and Label.
|
||||
|
||||
[FIX] Studio: Removed weak reference in ActionNode.
|
||||
|
||||
[FIX] UI: shouldStartLoading method should return value to js in js-binding.
|
||||
|
||||
[FIX] UI: Fixed scrollview render error.
|
||||
|
||||
[FIX] JS: Fixed win32 js project crash issue.
|
||||
|
||||
[FIX] UI: Button touch doesn't work with scale9 enabled.
|
||||
|
||||
[FIX] JS: Fixed evalString doesn't return result issue.
|
||||
|
||||
[FIX] JS: Fixed ComponentJS proxy management issue in JSB.
|
||||
|
||||
[FIX] Android: Fixed include in cocos network module.
|
||||
|
||||
[FIX] Network: Fixed web socket crash.
|
||||
|
||||
[FIX] UI: Fixed TextField missing default password style text setting.
|
||||
|
||||
[TEST] S9SpriteTest: Scale9Sprite fade actions with cascade opacity.
|
||||
|
||||
[TEST] Web: Removed default focus block from UIFocusTestVertical.
|
||||
|
||||
[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
|
||||
|
||||
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
|
||||
|
||||
Added setRenderingType, getRenderingType.
|
||||
|
||||
9. FontFNT
|
||||
|
||||
Added setFontSize, getOriginalFontSize.
|
||||
|
||||
10. Label
|
||||
|
||||
Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor.
|
||||
|
||||
11. AudioEngineImpl
|
||||
|
||||
Added AudioEngineImpl to implement FMOD.
|
||||
|
||||
12. Lua Module
|
||||
|
||||
Added luaval_to_node, node_to_luaval.
|
||||
|
||||
13. JS Module
|
||||
|
||||
Added js_cocos2dx_ComponentJS_create
|
||||
|
||||
14. ui::Text
|
||||
|
||||
Added isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor.
|
||||
|
||||
15. UITextTest_Clone
|
||||
|
||||
Added UITextTest_Clone class.
|
||||
|
||||
BIN
cocos2d/docs/cocos2dx_portrait.png
Normal file
BIN
cocos2d/docs/cocos2dx_portrait.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
2402
cocos2d/docs/doxygen.config
Normal file
2402
cocos2d/docs/doxygen.config
Normal file
File diff suppressed because it is too large
Load Diff
2402
cocos2d/docs/doxygen_white_book.config
Normal file
2402
cocos2d/docs/doxygen_white_book.config
Normal file
File diff suppressed because it is too large
Load Diff
BIN
cocos2d/docs/framework_architecture.jpg
Normal file
BIN
cocos2d/docs/framework_architecture.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 98 KiB |
BIN
cocos2d/docs/img-cocos.jpg
Normal file
BIN
cocos2d/docs/img-cocos.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user