我对AndEngine来说太新了,我不能说太多事要告诉你问题。 代码如下..
public class MainActivity extends BaseGameActivity {
private static final int CAMERA_WIDTH = 768;
private static final int CAMERA_HEIGHT = 1280;
Scene scene;
@Override
public EngineOptions onCreateEngineOptions() {
Camera mCamera = new Camera(0,0,CAMERA_WIDTH, CAMERA_HEIGHT);
EngineOptions options = new EngineOptions(true, ScreenOrientation.PORTRAIT_FIXED, new RatioResolutionPolicy(CAMERA_WIDTH,CAMERA_HEIGHT), mCamera);
return options;
// TODO Auto-generated method stub
}
@Override
public void onCreateResources(
OnCreateResourcesCallback pOnCreateResourcesCallback)
throws Exception {
// TODO Auto-generated method stub
pOnCreateResourcesCallback.onCreateResourcesFinished();
}
@Override
public void onCreateScene(OnCreateSceneCallback pOnCreateSceneCallback)
throws Exception {
// TODO Auto-generated method stub
this.scene = new Scene();
this.scene.setBackground(new Background(15,25,35));
pOnCreateSceneCallback.onCreateSceneFinished(this.scene);
}
@Override
public void onPopulateScene(Scene pScene,
OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {
// TODO Auto-generated method stub
}
}
此处还有logcat。(抱歉,但是logcat太长了)问题和解决方案是什么?
答案 0 :(得分:2)
从您的logcat获得java.lang.NoSuchMethodError: org.andengine.opengl.view.RenderSurfaceView.setEGLContextClientVersion
只是尝试google it ...你在AndEngine论坛上找到了可能的答案:
请注意,Eclipse中的Emulator不能与最新的GLES2 AndEngine一起使用。 See here...