Forum > Lua Binding > SetDeviceOrientation doesn't seem to be exposed to Lua

SetDeviceOrientation doesn't seem to be exposed to Lua

By balaam Posted 2012-03-14 16:12 Comments 3
balaam
  • Posts: 4

Is this a design decision or just something that was missed?

dualface
  • Posts: 61

#1 RE: 2012-03-15 01:34

SetDeviceOrientation() should be call in the AppDelegate::applicationDidFinishLaunching()

balaam
  • Posts: 4

#2 RE: 2012-03-16 10:37

Cool thanks. I take that as - it should never be called from Lua only from that method.

balaam
  • Posts: 4

#3 RE: 2012-03-16 11:44

I think I’m still missing something with this.

In cocos2dx\HelloLua\Classes\AppDelegate.cpp in the applicationDidFinishLaunching function just before return true at the end of the function I added pDirector->setDeviceOrientation(kCCDeviceOrientationPortrait).

Then I run build_native.sh from cygwin and package in ecplise but when the apk runs on the device it’s still landscape. Any idea what might be the problem?

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps