A "Button" can be created by:
ui::Button* button = ui::Button::create("button.png");
How can we use a sprite sheet for this ?
EDIT: If I just put the name of a sprite frame for example:
ui::Button* button = ui::Button::create("button");
Then it doesn't detect it - thinks there is a missing image.
You could pass an extra argument to the ui:Button:create
function.
You could use
ui::Button* button = ui::Button::create("button","","",TextureResType::PLIST);
to create a button with a sprite frame named "button".
For more information, please refer to the UIButton.h and UIButton.cpp files.