Does this work with creator?
I have an example from cocos js but I cannot seem to get it to work on android in creator.
Does this work with creator?
I have an example from cocos js but I cannot seem to get it to work on android in creator.
OK I Finally got this working. For Anyone else interested here is the code
onLoad: function () {
cc.inputManager.setAccelerometerEnabled(true);
cc.systemEvent.on(cc.SystemEvent.EventType.DEVICEMOTION, this.onDeviceMotionEvent, this);
},
onDeviceMotionEvent (event) {
var x = event.acc.x;
var y = event.acc.y;
// use as you wish
},