bool HelloWorld::init()
{
if ( !Layer::init() )
{
return false;
}
Device::setAccelerometerEnabled(true);
Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(EventListenerAcceleration::create([](Acceleration *a,Event *e){
log("x:%g,y:%g,z:%g",a->x,a->y,a->z);
}),this);
return true;
}