I write a game in lua, I want to use Accelerometer in it. I write code like this:
As you see I commented the second line code. If I removed the comment and open the second line code, there is an eror will be happened like this ‘method ’setAccelerometerInterval’ (a nil value)’. Why I can set the accelerometer interval? Is that anyone who know how to set the inverval? Thank you a lot!
If I’m not call setAccelerometerInterval function, the didAccelerate will be called at every frames, this is not what I want.
Thanks Martin Z! Finally I get the place of how to binding functions. It is at ./cocos2d_support/LuaCocos2d.cpp. At this cpp, we can see there are a list of functions binding code.