The Extension library contains some useful controls, such as UIButton, UIWidget, and UItableView.
When creating a new project in cocos2d-x 3.0, these libraries were all streamlined, so we had to manually add
Method:
1. Add an existing item: libGUI libExtension libCocostudio
2. reference the imported project and add dependencies.
3. Add the include directory: $ (EngineRoot)
$ (EngineRoot) cocos
$ (EngineRoot) cocos \ editor-support
4. Add a header file
# Include "extensions/cocos-ext.h"
# Include "gui/cocosGUI. h"
5. Add a naming Control
Using namespace cocos2d;
Using namespace cocos2d: extens-ext.h;
Using namespace gui;
6. Use
Button * button = Button: creatt (); button-> setTouchEnabled (true); button-> loadTextures ("1.png"," 2.png", "3.png "); button-> setPosition (Point (200,200); button-> addTouchEventListener ("this, toucheventselector (LoginScene: touchEvent): // method void LoginScene :: touchEvent (Object * psender, TouchEventType) {// your code}
These controls are easy to use and convenient. Of course, they can also be implemented using menus.
I don't know who is better at UIButton and Menu than in terms of performance.