我正在开发一个需要添加一些本机代码的libgdx项目。理想情况下,我想用RoboVM编译我所拥有的东西,在xcode中打开项目,然后从那里起飞。但问题是,当我用xcode打开项目时,我发现资产和plist文件,但没有代码可以使用。
作为参考,这是我在Android Studio中的启动器类,这是最初由libgdx向导生成的,除了顶部的注释之外:
@CustomClass("IosLauncher")
public class IOSLauncher extends IOSApplication.Delegate {
@Override
protected IOSApplication createApplication() {
IOSApplicationConfiguration config = new IOSApplicationConfiguration();
return new IOSApplication(new MyGdxGame(), config);
}
public static void main(String[] argv) {
NSAutoreleasePool pool = new NSAutoreleasePool();
UIApplication.main(argv, null, IOSLauncher.class);
pool.close();
}
}
这是gradle文件的ios相关位:
project(":ios") {
apply plugin: "java"
apply plugin: "robovm"
dependencies {
compile project(":core")
compile "org.robovm:robovm-rt:$roboVMVersion"
compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
}
}
这是我在Android Studio中选择“打开Xcode项目”时最终看到的内容: