AndEngine GLES2 - getting Black screen on emulator 4.1
- by dizworld.com
I'm new in andengine . I create following code
public class MainActivity extends BaseGameActivity {
static final int CAMERA_WIDTH = 800;
static final int CAMERA_HEIGHT = 480;
public Font mFont;
public Camera mCamera;
//A reference to the current scene
public Scene mCurrentScene;
public static BaseActivity instance;
public EngineOptions onCreateEngineOptions() {
instance = this;
mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
}
@Override
public void onCreateResources(OnCreateResourcesCallback arg0)
throws Exception {
mFont = FontFactory.create(this.getFontManager(),this.getTextureManager(), 256, 256,Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 32);
mFont.load();
}
@Override
public void onCreateScene(OnCreateSceneCallback arg0) throws Exception {
mEngine.registerUpdateHandler(new FPSLogger());
mCurrentScene = new Scene();
Log.v("Scene","enter");
mCurrentScene.setBackground(new Background(0.09804f, 0.7274f, 0.8f));
// return mCurrentScene;
}
@Override
public void onPopulateScene(Scene arg0, OnPopulateSceneCallback arg1)
throws Exception {
// TODO Auto-generated method stub
}
}
I got code on sites there is returning scene but in AndEngine GLES2 in method onCreateScene() there is no return scene ... so my First run is BLACK .. any suggestion :)