简体   繁体   中英

Cocos2dx using c++ and lua

I supposed to using the cocos2dx + C++ to do the most job in application, and use lua to some ui part job. And here is a question: In bool AppDelegate::applicationDidFinishLaunching() : I using this codes to config the design screen size

glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);

But what will happen if I change the config in config.lua.

CONFIG_SCREEN_ORIENTATION = "landscape"
-- design resolution
CONFIG_SCREEN_WIDTH  = 960
CONFIG_SCREEN_HEIGHT = 640
-- auto scale mode
CONFIG_SCREEN_AUTOSCALE = "FIXED_HEIGHT"

Is there any solution can resolve the config issue if I am using c++ and lua?

Finally, after some test, I found a way to resolve it. The c++ codes only work in the c++ enviroment, and the lua config only works in the lua enviroment, so we have to let the properties of them be same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM