rishabhjain86
rishabhjain86

Reputation: 21

Gyroscope using Cocos2d-x

Does Cocos2d-x gives support for using gyroscope? And if it isn't, then how can i use it?

Upvotes: 0

Views: 1165

Answers (3)

Serhiy
Serhiy

Reputation: 331

No. Cocos2d-x doesn't support gyroscope yet. Only accelerometer.

Upvotes: 2

AbsZero
AbsZero

Reputation: 65

Yes, but you should enable it manually. You also can add a event listener that way :

Device::setAccelerometerEnabled(true);
Device::setAccelerometerInterval(1 / 30.0);

auto accelerationListener = EventListenerAcceleration::create(CC_CALLBACK_2(GameplayLayer::onAcceleration, this));
_eventDispatcher->addEventListenerWithSceneGraphPriority(accelerationListener, this);

Upvotes: 0

applejday
applejday

Reputation: 1

Yes, you can see the class CCAccelerometer. and in the testcpp sample, there is a AccelerometerTest

Upvotes: 0

Related Questions