Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
Create a new C++ project and replace HelloWorldScene.cpp with the attached code: HelloWorldScene_cpp.txt
Compile and run.
Note that only two items where pushed into page_view. When both, ui::PageView::setIndicatorIndexNodesScale and ui::PageView::setIndicatorSpaceBetweenIndexNodes are called in that specific order, a third indicator will appear temporarily. Moving to the next page will make the indicator disappear. The spacing between the indicator nodes seems to be wrong too.
Temporary solution:
Calling ui::PageView::setIndicatorSpaceBetweenIndexNodes first and then ui::PageView::setIndicatorIndexNodesScale will prevent the extra indicator from appearing.
Adding page_view->forceDoLayout(); before the return statement seems to fix the problem. Not quite sure if the third indicator that appears is considered a bug, but if it isn't please close this issue.
Steps to Reproduce:
HelloWorldScene.cpp
with the attached code: HelloWorldScene_cpp.txtpage_view
. When both,ui::PageView::setIndicatorIndexNodesScale
andui::PageView::setIndicatorSpaceBetweenIndexNodes
are called in that specific order, a third indicator will appear temporarily. Moving to the next page will make the indicator disappear. The spacing between the indicator nodes seems to be wrong too.ui::PageView::setIndicatorSpaceBetweenIndexNodes
first and thenui::PageView::setIndicatorIndexNodesScale
will prevent the extra indicator from appearing.