简体   繁体   English

我仍然无法运行第一个andengine应用程序

[英]I still cannot run first andengine application

I'm too new for AndEngine and I can not say to much thing to tell you problem. 我对AndEngine来说太新了,我不能说太多东西告诉你问题。 Code is below.. 代码如下..

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

    }

}

Also here is the logcat .(sorry but logcat is too long) What is the problem and solution? 另外这里是logcat 。(对不起但是logcat太长了)有什么问题和解决方案?

From your logcat you have java.lang.NoSuchMethodError: org.andengine.opengl.view.RenderSurfaceView.setEGLContextClientVersion 从你的logcat中你有java.lang.NoSuchMethodError: org.andengine.opengl.view.RenderSurfaceView.setEGLContextClientVersion

just try to google it... and you find possible answer on AndEngine forums: 只是尝试谷歌...你在AndEngine论坛上找到了可能的答案:

Please note that the Emulator in Eclipse does not work with the latest GLES2 AndEngine. 请注意,Eclipse中的Emulator不能与最新的GLES2 AndEngine一起使用。 See here... 看这里...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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