auto start = MenuItemFont::create("ON");
auto stop =MenuItemFont::create("OFF");
auto toggle = MenuItemToggle::createWithCallback(
CC_CALLBACK_1(HellWord::menuONorOFFCallback,this),
start,
stop,
NULL
);
toggle->setPosition(Vec2(visibleSize.width/2,visibleSize.height/2));//设置坐标
auto menu =Menu::create(toggle,NULL);
menu->setPosition(Point::ZERO);
addChild(menu);
时间: 2024-09-28 23:02:10