Created
April 20, 2013 09:08
-
-
Save nipundavid/5425331 to your computer and use it in GitHub Desktop.
First AndEngine project, that will display a blue color background in the scene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.anblog; | |
import org.andengine.engine.camera.Camera; | |
import org.andengine.engine.options.EngineOptions; | |
import org.andengine.engine.options.ScreenOrientation; | |
import org.andengine.engine.options.WakeLockOptions; | |
import org.andengine.engine.options.resolutionpolicy.FillResolutionPolicy; | |
import org.andengine.entity.scene.Scene; | |
import org.andengine.entity.scene.background.Background; | |
import org.andengine.ui.activity.SimpleBaseGameActivity; | |
public class MainActivity extends SimpleBaseGameActivity{ | |
private static final int WIDTH = 800; | |
private static final int HEIGHT = 480; | |
private Camera mCamera; | |
private Scene mScene; | |
private EngineOptions engineOptions; | |
@Override | |
public EngineOptions onCreateEngineOptions() { | |
mCamera = new Camera(0, 0, WIDTH, HEIGHT); | |
engineOptions = new EngineOptions(true,ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(),mCamera); | |
engineOptions.setWakeLockOptions(WakeLockOptions.SCREEN_ON); | |
return engineOptions; | |
} | |
@Override | |
protected void onCreateResources() { | |
} | |
@Override | |
protected Scene onCreateScene() { | |
mScene = new Scene(); | |
mScene.setBackground(new Background(0.09804f, 0.6274f, 0.8784f)); | |
return mScene; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment