cocos2d-x之物理按键初试

bool HelloWorld::init()

{

if ( !Layer::init() )

{

return false;

}

auto listener=EventListenerKeyboard::create();

listener->onKeyReleased = [](EventKeyboard::KeyCode code,Event *e){

log("key code: %d",code);

switch (code) {

case EventKeyboard::KeyCode::KEY_BACKSPACE:

Director::getInstance()->end();

break;

default:

break;

}

};

return true;

}

上一篇:自动获取客户端的ip地址


下一篇:(整理) .NET IIS性能优化