From c4ed577589bc05bc13410e3e10cbacd91d1c9062 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Mon, 21 Dec 2015 16:56:35 +0800 Subject: [PATCH 1/4] Update cocos2d-x 3.10 Release note. --- docs/RELEASE_NOTES.md | 376 ++++++++++++++++++++---------------------- 1 file changed, 183 insertions(+), 193 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index a8940da63a..3c4a58d997 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,7 +2,7 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [Cocos2d-x 3.9 Release Notes](#cocos2d-x-39-release-notes) +- [Cocos2d-x 3.10 Release Notes](#cocos2d-x-310-release-notes) - [Misc Information](#misc-information) - [Requirements](#requirements) - [Runtime Requirements](#runtime-requirements) @@ -14,18 +14,18 @@ - [Windows](#windows) - [Linux](#linux) - [How to start a new game](#how-to-start-a-new-game) -- [v3.9](#v39) - - [Highlights features, improvements and API updates of v3.9](#highlights-features-improvements-and-api-updates-of-v39) - - [The main features in detail of Cocos2d-x v3.9:](#the-main-features-in-detail-of-cocos2d-x-v39) - - [3D Module](#3d-module) - - [2D Module](#2d-module) +- [v](#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) -# Cocos2d-x 3.9 Release Notes # +# Cocos2d-x 3.10 Release Notes # # Misc Information @@ -146,287 +146,277 @@ Use Cocos Console to create a new game: cocos new -l cpp|js|lua MyNewGame ``` -# v3.9 +# v3.10 -## Highlights features, improvements and API updates of v3.9 +## Highlights features, improvements and API updates of v3.10 -We are happy to announce the release of Cocos2d-x v3.9. Following are the highlighted features, improvements and API updates in this version. +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. 3D Module: - - Added 3D MotionStreak to support streak effect. - - Refined Sprite3D to support material system. -2. 2D Module: - - Added frame callback function and animation callback function. - - Added script component system. - - Reconstruction of 2D physics with Component. - - Improved EditBox implemention on iOS and Win32 platform. - - Removed dependence of libcurl on AssetsManager, AssetsManagerEx and Downloader (iOS & Android). - - Improved particle performance. +1. UI System: + - Reimplemented Scale9Sprite and improve the scale9sprite performance and reduce memory consumption. + - Changed PageView to derived from ListView. + - Added PageView indicator. + - Added three Overflow type to new label. + - RichText supported new line element. +2. AudioEngine + - AudioEngine on Linux replace the original SimpleAudioEngine with a new version of FMOD, now AudioEngine support all platforms. 3. Others: - - Supported Action inheritance, update function overwriting in JSB. - - Improved ScrollView performance in Web engine. - - Improved Scale9Sprite performance in Web engine. - - Decoupled Sprite's setTexture and updateColor in Web engine. - - Added support for debugging and release on real devices with Xcode7 and iOS9. + - Added Application::getVersion() to get the app version. + - Set focus to Widget when touched. + - Improved JS bindings with more secured memory management. -## The main features in detail of Cocos2d-x v3.9: -### 3D Module +## The main features in detail of Cocos2d-x v3.10: -1. 3D MotionStreak +### UI System + +1. Reimplemented Scale9Sprite and improve the scale9sprite performance and reduce memory consumption. + + - Now the Slice sprite uses 16 vertices and 54 indices instead of the old 9 sprite way. + + - The memory consumption is much lower than the previous implementation. And it is also more time efficient. + + - Add RenderingType to slice sprite. When Scale9Enable is true, then we have two rendering type here. + + - 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 to rendering. + + - 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. + +2. Changed PageView to derived from ListView. + + 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 subclass from ListView. + + By this, PageView becomes more simplified and maintainable because it considers only paging implementation. + +3. Added PageView indicator - In this version, 3D MotionStreak is added to support streak effect. Check the testcase: [Sprite3DTest](https://github.com/cocos2d/cocos2d-x/blob/v3/tests/cpp-tests/Classes/Sprite3DTest/Sprite3DTest.cpp#L2472) to see how to use it. + PageView now has a page indicator which is represented as a list of small circles. -2. Sprite3D +4. Added three Overflow type to new label. - Added Sprite3D material class. It will be easy and convenient to create internal material. + Add three different type of Overflow to Label. -### 2D Module + enum class Overflow + { + //for keep back compatibility + NORMAL, + /** + * In SHRINK mode, the font size will change dynamically to adapt the content size. + */ + SHRINK, + /** + *In CLAMP mode, when label content goes out of the bounding box, it will be clipped. + */ + CLAMP, + /** + *In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically. + */ + RESIZE_HEIGHT + }; -1. Frame callback function and animation callback function + Limitations: - Three interfaces are added in ActionTimelineData class, which are addFrameEndCallFunc, removeFrameEndCall and clearFrameEndCalls. It will be easy to add or remove specific frame event. + Currently the System font doesn't support these Overflow feature and Char Map font doesn't support Shrink feature. -2. Script Component +5. RichText supported new line element. + + Added new "NEWLINE" type of RichElement to RichText. You can add new line to RichText. - Script component is used to extend c++ Nodes. You can add a script component to a Node, then the script component will receive onEnter,onExit and update events. For example: - ```c++ - // create a sprite and add a lua component auto player = - Sprite::create("player.png"); + +### AudioEngine - auto luaComponent = ComponentLua::create("player.lua"); - player->addComponent(luaComponent); - ``` - - ```lua - // player.lua - local player = { - onEnter = function(self) - -- do some things in onEnter - end - - onExit = function(slef) - -- do some things in onExit - end - - update = function(self) - -- do some things every frame - end - } - - -- it is needed to return player to let c++ nodes know it - return player - ``` - - Javascript can work as the same way, just use ComponentJS instead of ComponentLua. - - There are some differences between lua component and Javascript component: - - Should return the object in lua component, in Javascript, you only have to extend cc.ComponentJS, and ensure the result of the last statement is the class of Component. - - Lua component can only be used in lua projects, Javascript component can only be used in Javascript projects. - - More detail usage please refer to: `tests/lua-tests/src/ComponentTest` and `tests/js-tests/src/ComponentTest` - - -3. 2D Physics - - Before v3.9, there are many physics related codes in Node, such as Node::setPhysicsBody(). Since v3.9, we move these codes into physics component. - - After using physics component, the way to use physics is changed. Before v3.9, you can use physics like this: - - ``` - auto node = Node::create(); - node->setPhysicsBody(PhysicsBody::createEdgeBox(...)); - ``` - - Since v3.9 you should use like this: - - ``` - auto node = Node::create(); - node->addComponent(PhysicsBody::createEdgeBox(...)); - - ``` - -4. EditBox implemention on iOS and Win32 platform - - - Specify the maximum number of characters in the dialog box. - - Support password input. - - Games will continue when the dialogue box pops up. - - Sync the content in dialogue box. - -5. Remove dependence of curl on AssetsManager, AssetsManagerEx and Downloader (iOS & Android) - - From v3.9, iOS and Android version will not depend on libcurl, which make - the game package smaller and solve some bugs caused by libcurl. Stability has - been improved with the updated iOS and Android system. - -6. Improved particle performance. +1. AudioEngine on Linux replace the original SimpleAudioEngine with a new version of FMOD, now AudioEngine support all platforms. ### Others -1. Supported Action inheritance, update function overwriting in JSB +1. Added Application::getVersion() to get the app version. - In previous version of JSB, developers cannot inherit Action class in JS script, such as Action / ActionInterval / ActionInstant, for their update function will not be called. In v3.9, developers can create subclass of Action and make extensions. More detail usage please refer to the textcase in ActionTest / ActionCustomTest. + Added a method to the Application class to get the version of the app on iOS/Mac/Android/Win8, on the remaining platforms that don't have app versions it should return an empty string. -2. ScrollView performance on Web engine + The feature has been requested in this discussion thread: http://discuss.cocos2d-x.org/t/check-app-version/6294/5 - ScrollView and ListView are the popular UI controls in Web engine. Their - performance is not perfect in previous versions, especially when there are multiple sub-controls. In v3.9, we have improved its rendering performance. They only act on the contents displayed on the current screen. Test - date shows that, comparing with v3.8, rendering efficiency of v3.9 have been improved for twice to four times in different devices and browsers. +2. Set focus to Widget when touched. -3. Scale9Sprite performance on Web engine + Automatically set focus for widgets if focus enabled. - In this version, we have changed the way to construct 9-slice sprite. The engine uses 9 rendering commands instead of the 9 nodes in previous versions. This helps to reduce memory usage and improve rendering performance. -4. Decoupled Sprite's setTexture and updateColor in Web engine. +3. Improved JS bindings with more secured memory management. - - Organized the rendering logic in Sprite. UpdateColor is accomplished by texture instead of the Sprite. - - Fixed a bug about image with alpha channel that when the image is set to black, there is color difference between previous and current version. - - Improved texture update logic to reduce texture updates when changing colors. - - Improved the logic about the rendering function in SpriteCanvasRenderCmd. - - Removed some duplicate codes about updateColor. + Improvement covered both auto bindings and manual bindings. + All changes follow Generational GC style. -5. Support for debugging and release on real devices with Xcode7 and iOS9 + The background of this feature: [http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx](http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx "http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx") - In v3.8.1, we have made it possible to debug on Xcode7. However, there was a bug with iOS9 real device debuging, and in v3.9, we have fixed the bug. + This requires to adopt the new GC coding style in all JSB code. + The new GC coding style can be verified with this tool: [https://github.com/joshuastray/RootAnalysis](https://github.com/joshuastray/RootAnalysis "https://github.com/joshuastray/RootAnalysis") ## Other changes +[NEW] UIText::clone supports clone the text effect. -[NEW] Label: Added line spacing/leading feature to Label. +[NEW] UI: Added methods to query label effect state. + +[REFINE] IOS: Added virtual keyword for some render related function. -[NEW] ListView: Added APIs to scroll to specific item in list. +[REFINE] UI: Fixed boring deprecated warning in HttpRequest. -[NEW] ListView: Added APIs to get an item in specific position like center, leftmost, rightmost, topmost and bottommost. +[REFINE] Network: Fixed Downloader bug on iOS & Android platform. -[NEW] ListView: Added a feature for magnetic scrolling. +[REFINE] Studio: Fixed deprecation warning in SkeletonRenderer. -[NEW] Animate: Added ActionTimeline::setAnimationEndCallBack and ActionTimeline::addFrameEndCallFunc. +[REFINE] JS: Added js test case for fix, improve template. -[NEW] Animate: Added CSLoader::createNodeWithVisibleSize, CSLoader::createNodeWithVisibleSize and moved "ui::Helper::DoLayout" into them. +[REFINE] Network: Permit http access to cocos2d-x.org in test projects on iOS. -[NEW] Stuio: Added support for Cocos Studio Light3D. +[REFINE] Network: Crash when removing a remotely downloaded image from texture +cache in js-binding. -[NEW] Platform: Added the missing CURL support to the Windows 10 UWP version. +[REFINE] Win10: WinRT project update version to v3.10. -[NEW] Platform: Added UIEditBox support on linux platform. +[REFINE] Console: Added quiet option for Cocos Toolkit. -[REFINE] 3D: Added non-null checks in PUScriptCompiler::visit before dereferencing. +[REFINE] JS: New GC model for js-binding. -[REFINE] 3D: Refined SkyboxBrush by making the shader parameter take effect at once. +[REFINE] Doc: Fixed typos in documentation and comments. -[REFINE] Label: Changed label font size type to float to support high precision when font size is small. +[REFINE] UI: Updated controlButton size calculate with new Scale9Sprite logic. -[REFINE] ListView: Fixed an issue that list view's Magnetic::CENTER is not working well when non-bounceable. +[REFINE] Win10: Added missing _USRJSSTATIC preprocessor define for ARM builds. -[REFINE] ListView: Added feature of jumping to a specific item in list view. +[REFINE] JS: Added ccvector_to / ccmap_to converted to new js-binding API. -[REFINE] Sprite: Added a "unsupport image format!" log when creating a sprite in CCImage.cpp. +[REFINE] UI: Slider misprint fix. -[REFINE] ScrollView: Merge logics of Scroll View for scroll by inertia and auto scroll into one. +[FIX] Core: Fixed premultiplyAlpha for mipmaps and compressed textures. -[REFINE] Animate: Moved initialization of image to an appropriate location, because it always called twice in -SpriteFrameCache::addSpriteFramesWithFile(). +[FIX] UI: Fixed Scale9sprite rendering error when content size smaller than the sum of leftInset and rightInset. -[REFINE] Simulator: Changed the size of startFlag to 13. +[FIX] Win32: Fixed EditBox crash when removing an EditBox in a scheduler. -[REFINE] Simulator: Show Node and Skeleton in the middle of the simulator. +[FIX] Android: Fixed cannot add view to mFrameLayout when extends Cocos2dxActivity. -[REFINE] Simulator: Removed screen direction check in simulator to avoid render error. +[FIX] 2D: Fixed actionNode set at wrong position bug. -[REFINE] Pysics: Refined components to improve physics performance. +[FIX] 3D: Fixed the movement of PUParticle lags one frame. -[REFINE] UI: Refined ComponentContainer to improve performance. +[FIX] UI: Fixed the wront argument of setPlaceholderFontName in EditBox. -[REFINE] UI: EventListenerMouse will dispatch EventMouse events. +[FIX] UI: Fixed EditBox editBoxEditingDidEnd may use the original text after change the text of EditBox in user script. -[REFINE] OpenGL: Added check for glfwCreateWindow. +[FIX] Audio: Fixed `FinishCallback` never be called in Windows. -[REFINE] Platform: Fixed a crash on xiaomi2 if Cocos2d-x is built as a dynamic library. +[FIX] UI: Fixed Layout stencil clipping nested with Clipping Node rendering issue. -[REFINE] Platform: Updated libcococs2d name to v3.9 on WinRT platforms. +[FIX] UI: Keyboard doesn't hide when click the screen outside of EditBox on iOS platform. -[REFINE] Platform: Added some support for mouse on WinRT. Include: Show/Hide mouse cursor; Mouse event -implemented similar Desktop version; Left button send mouse event and touch; Support other mouse button and scroll -wheel. +[FIX] UI: Fixed a fatal bug in EditBox implement on Windows platform. -[REFINE] Platform: Correct the convertion between unicode and utf8 on WinRT. +[FIX] UI: Fixed edit box setPlaceholderFontName and scale font size issue. -[REFINE] Platform: Improved EditBox implement on Win32 platform. +[FIX] Core: Fixed memory leak when initWithImage() failed. -[REFINE] JS: Add jsb.fileUtils.writeDataToFile(). +[FIX] Network: CCDownloader on iOS is broken in v3.9 js-binding. -[REFINE] JS: Set js templates Mac target platform from null to 10.7. +[FIX] JS: Bindings fixes for Menu, Sprite and Label. -[REFINE] JS: Removed the static define of variable in headfile of ScriptingCore. +[FIX] Studio: Removed weak reference in ActionNode. -[REFINE] Lua: Added AssetsManagerEx constants UPDATE_FAILED and ERROR_DECOMPRESS in Lua. +[FIX] UI: shouldStartLoading method should return value to js in js-binding. -[REFINE] Lua / JS: Refined lua/js binding tool. +[FIX] UI: Fixed scrollview render error. -[REFINE] I/O: Refined AssetsManagerEx unzipping by using async. +[FIX] JS: Fixed win32 js project crash issue. -[REFINE] Web: Improved logic of jsb_boot.js to sync with the web engine behavior. +[FIX] UI: Button touch doesn't work with scale9 enabled. -[REFINE] Web: Sync with CCBoot for web. +[FIX] JS: Fixed evalString doesn't return result issue. -[REFINE] Build: Fixed various compiler warnings on Xcode 7. +[FIX] JS: Fixed ComponentJS proxy management issue in JSB. -[REFINE] Build: Fixed Wformat-security warning on Xcode. +[FIX] Android: Fixed include in cocos network module. -[REFINE] Build: Fixed a compile error in __LayerRGBA. +[FIX] Network: Fixed web socket crash. -[REFINE] Tool: Added tools for generating documents automatically. +[FIX] UI: Fixed TextField missing default password style text setting. -[REFINE] Doc: Clean up the code of setRect() function. +[TEST] S9SpriteTest: Scale9Sprite fade actions with cascade opacity. -[REFINE] Doc: Fixed a minor typo and renamed INTIAL_CAPS_ALL_CHARACTERS to INITIAL_CAPS_ALL_CHARACTERS -in UIEditBox. +[TEST] Web: Removed default focus block from UIFocusTestVertical. -You can also take a look at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). +[TEST] Lua: Fixed pageViewTest Horizontal scroll won't work in Lua-test. + +You can also take a l +ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). ## NEW APIS -1. JSB Module +1. RichText - Added jsb.fileUtils.writeDataToFile + Added RichElementNewLine class to create new RichText Element. -2. Sprite3D + 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") - Added Sprite3Dmaterial class to make it easy to create innate material. +2. PageViewIndicator -3. ActionTimelineData + Added PageViewIndicator class to create PageViewIndicator. - Three interfaces are added in ActionTimelineData class, which are addFrameEndCallFunc, removeFrameEndCall and clearFrameEndCalls. + 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") -4. ActionTimeline::removeFrameEndCallFunc +3. PageView -5. Improvements for ListView + 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") - - Add APIs to scroll to specific item in list. - - Add APIs to get an item in specific position like center, leftmost, rightmost, topmost and bottommost. - - Add a feature for magnetic scrolling. +4. ApplicationProtocol - For more information: https://github.com/cocos2d/cocos2d-x/pull/13723 + Added the API getVersion. -6. Node - Added the missing API getChildByTag +5. PolygonInfo -7. Label + Added the API setTriangles. - Added setLineSpacing, getLineSpacing +6. Scale9Sprite -8. CSLoader + Added adjustNoneScale9ImagePosition, configureSimpleModeRendering, calculateUV, calculateVertices, calculateTriangles, setRenderingType, getRenderingType. - Added createNodeWithVisibleSize, createNodeWithVisibleSize -9. ComponentContainer +7. CWin32InputBox - Removed isEmpty + Added GetMsgProc, onWin32InputBoxClose. -10. Sprite +8. FontAtlas - Removed debugDraw(bool on) + Added scaleFontLetterDefinition. + +9. FontFNT + + Added setFontSize, getOriginalFontSize. + +10. Label + + Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, multilineTextWrap, shrinkLabelToContentSize, isHorizontalClamp, isVerticalClamp, getRenderingFontSize, rescaleWithOriginalFontSize, updateBMFontScale, scaleFontSizeDown, setTTFConfigInternal, setBMFontSizeInternal, restoreFontSize, updateLetterSpriteScale, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. + +11. AudioEngineImpl + + Added AudioEngineImpl to implement FMOD. + +12. JS Module + + Added luaval_to_node, node_to_luaval, js_cocos2dx_ComponentJS_create. + + +13. Widget_mac.h + + Added getCurAppName. + + +14. Text + + Added isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. + +15. UITextTest_Clone + + Added UITextTest_Clone class. + \ No newline at end of file From 722669b3e2d03c7e2dfe37449f4be3f5b97c802a Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Fri, 25 Dec 2015 18:58:31 +0800 Subject: [PATCH 2/4] Update Release notes. --- docs/RELEASE_NOTES.md | 156 ++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 90 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 3c4a58d997..41ebe9c3ca 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -154,105 +154,90 @@ We are happy to announce the release of Cocos2d-x v3.10. Following are the highl 1. UI System: - Reimplemented Scale9Sprite and improve the scale9sprite performance and reduce memory consumption. - - Changed PageView to derived from ListView. - - Added PageView indicator. - - Added three Overflow type to new label. - - RichText supported new line element. -2. AudioEngine - - AudioEngine on Linux replace the original SimpleAudioEngine with a new version of FMOD, now AudioEngine support all platforms. -3. Others: - - Added Application::getVersion() to get the app version. - - Set focus to Widget when touched. - - Improved JS bindings with more secured memory management. - + - Changed PageView to derived from ListView, PageView can be added any widget as child. + - Added three overflow type to new label: CLAMP,SHRINK,RESIZE_HEIGHT. +2. JSModule: + - Improved JS bindings with more secured memory management, and enhance the stability of the engine, streamline all JSB code with the GC coding style of SpiderMonkey([https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide")). ## The main features in detail of Cocos2d-x v3.10: ### UI System -1. Reimplemented Scale9Sprite and improve the scale9sprite performance and reduce memory consumption. +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 sprite way, The memory consumption is much lower than the previous implementation, and it is also more time efficient. - - Now the Slice sprite uses 16 vertices and 54 indices instead of the old 9 sprite way. + 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 to rendering, for example: - - The memory consumption is much lower than the previous implementation. And it is also more time efficient. + auto blocks = ui::Scale9Sprite::createWithSpriteFrameName("blocks9c.png"); + //When setting to SIMPLE, only 4 vertexes is used to rendering. + blocks->setRenderingType(Scale9Sprite::RenderingType::SIMPLE); - - Add RenderingType to slice sprite. When Scale9Enable is true, then we have two rendering type here. + 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: - - 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 to rendering. - - - 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. - -2. Changed PageView to derived from ListView. + 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 be added any 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 subclass from ListView. - By this, PageView becomes more simplified and maintainable because it considers only paging implementation. + By this, PageView becomes more simplified and maintainable because it considers only paging implementation. for example: -3. Added PageView indicator - - PageView now has a page indicator which is represented as a list of small circles. + // 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); -4. Added three Overflow type to new label. - - Add three different type of Overflow to Label. - - enum class Overflow + int pageCount = 4; + for (int i = 0; i < pageCount; ++i) { - //for keep back compatibility - NORMAL, - /** - * In SHRINK mode, the font size will change dynamically to adapt the content size. - */ - SHRINK, - /** - *In CLAMP mode, when label content goes out of the bounding box, it will be clipped. - */ - CLAMP, - /** - *In RESIZE_HEIGHT mode, you can only change the width of label and the height is changed automatically. - */ - RESIZE_HEIGHT - }; + 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); - Limitations: - - Currently the System font doesn't support these Overflow feature and Char Map font doesn't support Shrink feature. - -5. RichText supported new line element. - - Added new "NEWLINE" type of RichElement to RichText. You can add new line to RichText. - - - -### AudioEngine + More detail usage please refer to: tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIPageViewTest/UIPageViewTest.cpp. -1. AudioEngine on Linux replace the original SimpleAudioEngine with a new version of FMOD, now AudioEngine support all platforms. + +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); -### Others + More detail usage please refer to: tests/cpp-tests/Classes/LabelTest/LabelTestNew.cpp. -1. Added Application::getVersion() to get the app version. - - Added a method to the Application class to get the version of the app on iOS/Mac/Android/Win8, on the remaining platforms that don't have app versions it should return an empty string. - - The feature has been requested in this discussion thread: http://discuss.cocos2d-x.org/t/check-app-version/6294/5 - -2. Set focus to Widget when touched. - - Automatically set focus for widgets if focus enabled. - - -3. Improved JS bindings with more secured memory management. - - Improvement covered both auto bindings and manual bindings. - All changes follow Generational GC style. - - The background of this feature: [http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx](http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx "http://blogs.msdn.com/b/abhinaba/archive/2009/03/02/back-to-basics-generational-garbage-collection.aspx") - - This requires to adopt the new GC coding style in all JSB code. - - The new GC coding style can be verified with this tool: [https://github.com/joshuastray/RootAnalysis](https://github.com/joshuastray/RootAnalysis "https://github.com/joshuastray/RootAnalysis") + 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 it's 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. @@ -349,7 +334,6 @@ cache in js-binding. You can also take a l ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). - ## NEW APIS 1. RichText @@ -380,15 +364,7 @@ ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGEL 6. Scale9Sprite - Added adjustNoneScale9ImagePosition, configureSimpleModeRendering, calculateUV, calculateVertices, calculateTriangles, setRenderingType, getRenderingType. - -7. CWin32InputBox - - Added GetMsgProc, onWin32InputBoxClose. - -8. FontAtlas - - Added scaleFontLetterDefinition. + Added setRenderingType, getRenderingType. 9. FontFNT @@ -396,7 +372,7 @@ ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGEL 10. Label - Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, multilineTextWrap, shrinkLabelToContentSize, isHorizontalClamp, isVerticalClamp, getRenderingFontSize, rescaleWithOriginalFontSize, updateBMFontScale, scaleFontSizeDown, setTTFConfigInternal, setBMFontSizeInternal, restoreFontSize, updateLetterSpriteScale, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. + Added setBMFontSize, getBMFontSize, enableWrap, isWrapEnabled, setOverflow, getOverflow, initWithTTF, isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. 11. AudioEngineImpl @@ -412,7 +388,7 @@ ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGEL Added getCurAppName. -14. Text +14. ui::Text Added isShadowEnabled, getShadowOffset, getShadowBlurRadius, getShadowColor, getOutlineSize, getLabelEffectType, getEffectColor. From 92d5d0bde7764743494b0a6bea04d997bb969f55 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Tue, 29 Dec 2015 09:48:14 +0800 Subject: [PATCH 3/4] [v](#v310) -> [v3.10](#v310) --- docs/RELEASE_NOTES.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 41ebe9c3ca..43eb8712e5 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -2,7 +2,8 @@ **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* -- [Cocos2d-x 3.10 Release Notes](#cocos2d-x-310-release-notes) +- [Cocos2d-x 3.10 Release Notes](#cocos2d-x- +- -release-notes) - [Misc Information](#misc-information) - [Requirements](#requirements) - [Runtime Requirements](#runtime-requirements) @@ -14,7 +15,7 @@ - [Windows](#windows) - [Linux](#linux) - [How to start a new game](#how-to-start-a-new-game) -- [v](#v310) +- [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) From d3525d8a1d31bc6421ee931a5ab1ab2bf7e77448 Mon Sep 17 00:00:00 2001 From: zhangcheng Date: Thu, 31 Dec 2015 15:07:48 +0800 Subject: [PATCH 4/4] 1, Fix error english explain. 2, Fix error API. 3, Fix some bugs. --- docs/RELEASE_NOTES.md | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 43eb8712e5..f3d4ffd57e 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -158,7 +158,7 @@ We are happy to announce the release of Cocos2d-x v3.10. Following are the highl - Changed PageView to derived from ListView, PageView can be added any widget as child. - Added three overflow type to new label: CLAMP,SHRINK,RESIZE_HEIGHT. 2. JSModule: - - Improved JS bindings with more secured memory management, and enhance the stability of the engine, streamline all JSB code with the GC coding style of SpiderMonkey([https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide")). + - Improved JS bindings with more secured memory management, and enhance the stability of the engine, streamline all JSB code with the [GC coding style of SpiderMonkey](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/GC_Rooting_Guide). ## The main features in detail of Cocos2d-x v3.10: @@ -166,25 +166,25 @@ We are happy to announce the release of Cocos2d-x v3.10. Following are the highl 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 sprite way, The memory consumption is much lower than the previous implementation, and it is also more time efficient. + 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 to rendering, for example: + 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: + 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 be added any widget as child. +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 subclass from ListView. + 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 this, PageView becomes more simplified and maintainable because it considers only paging implementation. for example: + 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); @@ -225,7 +225,7 @@ We are happy to announce the release of Cocos2d-x v3.10. Following are the highl 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: + 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); @@ -233,8 +233,9 @@ We are happy to announce the release of Cocos2d-x v3.10. Following are the highl 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 it's font size.System font only support Overflow::Normal and Overflow::RESIZE_HEIGHT. + + + 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. @@ -332,8 +333,7 @@ cache in js-binding. [TEST] Lua: Fixed pageViewTest Horizontal scroll won't work in Lua-test. -You can also take a l -ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). +You can also take a look at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGELOG). ## NEW APIS @@ -379,15 +379,13 @@ ook at the [full changelog](https://github.com/cocos2d/cocos2d-x/blob/v3/CHANGEL Added AudioEngineImpl to implement FMOD. -12. JS Module +12. Lua Module - Added luaval_to_node, node_to_luaval, js_cocos2dx_ComponentJS_create. + Added luaval_to_node, node_to_luaval. +13. JS Module -13. Widget_mac.h - - Added getCurAppName. - + Added js_cocos2dx_ComponentJS_create 14. ui::Text