AndEngine GLES2 - getting Black screen on emulator 4.1
Posted
by
dizworld.com
on Game Development
See other posts from Game Development
or by dizworld.com
Published on 2012-07-27T07:12:41Z
Indexed on
2012/10/21
23:20 UTC
Read the original article
Hit count: 252
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 :)
© Game Development or respective owner