Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS project missing #1

Open
ghost opened this issue Feb 15, 2013 · 5 comments
Open

iOS project missing #1

ghost opened this issue Feb 15, 2013 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 15, 2013

I was able to setup a iOS project with Cocos2d-x, but it does not worked out.

@timcloss
Copy link
Contributor

Hi there
Please provide more info on what problems you are having. Compiler errors? Linker errors? Runtime errors?
Cheers,
Tim

@ghost
Copy link
Author

ghost commented Feb 16, 2013

Compilation & Linker worked fine.

Runtime errors !

Problems with file path. I added OpenQuick Lua source files to the Resources/ as a directory. In execution of main.lua sample the Lua runtime could not access the OpenQuick lua files.

Ok, in Cocos2d-x regular Lua you have to add "search path" for the Lua files. Can't see where I have to add this in openquick C++ AppDelegate.cpp?!!

@timcloss
Copy link
Contributor

Ignore anything you know about Cocos2d-x and Lua! OpenQuick does not use Cocos2d-x's existing Lua bindings, or Lua set-up code.

Your iOS project needs to set its root data folder to be one level above your "quicklua" folder. This is, I believe, a setting of the Xcode project. For example, for Windows the Visual Studio project for the "Hello World" sample sets the root data folder to /samples/HelloWorld/proj.win32.

Does that help?

@ghost
Copy link
Author

ghost commented Feb 16, 2013

Yes that helps. Thanks.

Will give it a spin later...

@sbc100
Copy link
Contributor

sbc100 commented Mar 16, 2013

I think that on some (many?) platforms you may well need/want the call to luaengine->addSearchPath().

cocos2dx has a virtual filesystem that knows how to look for files in one or more locations. lua (even the one
the ships with cococs) uses fopen() directly and is unaware of the cocos2dx file paths. If you can set the current working directory to your resource folder then you are ok, but I think a better solution is to modify cocos so that either lua doesn't use fopen directly or is at least made aware of the cococs path list.

That way you can also take advantage of the alternate resource dir system that cocos provides for assets and provide "HD" lua files if you really want to :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants