Monday 15 February 2010

Not Getting Interface In android app using AndEngine -


I'm working on a game in Android. I want to display my interface which contains some pictures. I have a folder in the property named GFX. There are images in this folder. I have written this code.

Public Class Menaktiviti Simple badge game activity increase {

  private static Int CAMERA_WIDTH = 800; Private static id CAMERA_HEIGHT = 480; Personal ITex's Regions MbfFreenditation Regeon, MTVactivity Regions, Mering 1, Mering 2, Mering 3; Private Sprite MT5, MT4, MT3; @ Override protected void saved create (bundled Instansstet) {Suprknkret (saved Instensstet); SetContentView (R.layout.activity_main); } @ Override Public Boolean On Crate Option Menu (Menu Menu) {// Enhancing Menu; It adds the item to the Action Bar if it exists GetMenuInflater (). Fluo (R. menu menu, menu); Back true; } @ Create Engine option on override public engine option () {// TODO auto-generated method stub final camera camera = new camera (0,0, camera_wind, camera_height); Return the new engine option (True, Screen Orientation .LANDSCAPE_FIXED, New Licensing Policy (CAMERA_WIDTH, CAMERA_HEIGHT), Camera); // return tap; } @Override protected void onCreateResources () {// TODO Auto-generated method stub try {// 1 - set up bitmap texture ITexture backgroundTexture = new BitmapTexture (this.getTextureManager (), New IInputStreamOpener () {@Override public InputStream open ( ) IOException throws {return getAssets (). Open ("gfx / background.png");}}); ITexture towerTexture = new BitmapTexture (this.getTextureManager (), New IInputStreamOpener () {.;} @Override public InputStream (open) IOException {return getAssets () open ( "gfx / tower.png") throws}); ITexture ring1 = new BitmapTexture (this.getTextureManager (), New IInputStreamOpener () {@Override public InputStream (open) throws IOException {return getAssets () open ( "gfx / ring1.png") ;.}}); ITexture Ring2 = new BitmapTexture (this.getTextureManager (), New IInputStreamOpener () {@Override public InputStream (open) throws IOException {return getAssets () open ( "gfx / ring2.png") ;.}}); ITexture ring3 = new BitmapTexture (this.getTextureManager (), New IInputStreamOpener () {@Override public InputStream (open) throws IOException {return getAssets () open ( "gfx / ring3.png") ;.}}); // 2 - Load the bitmap texture in VRAM backgroundEction.load (); TowerTexture.load (); Ring1.load (); Ring2.load (); Ring3.load (); // 3 - Set this to texture areas. MacBackfitRegion = Texture Refinements Extra Framework (Background Reference); This. MTV Textiles RegEG = Texture Silk Factory Extra Framework (Tower Picture); This.mRing1 = TextureRegionFactory.extractFromTexture (ring 1); This.mRing2 = TextureRegionFactory.extractFromTtexture (ring2); This.mRing3 = TextureRegionFactory.extractFromTtexture (ring3); } Hold (IOException e) {Debug.e (e); }} @ Override protected view onCreateScene () {// TODO auto generated method stub last visual view = new view (); Sprite Backgroundsprit = New Sprites (0, 0, this.mBackgroundTextureRegion, getVertexBufferObjectManager ()); Scene.attachChild (backgroundSprite); // 2 - Add towers mTower1 = New Sprite (192, 63, it. MT Textile Regions, getVertexBufferObjectManager ()); MTower2 = New Sprite (400, 63, this. Meter Texture Regions, getVertexBufferObjectManager ()); MTower3 = New Sprite (604, 63, this.mTowerTextureRegion, getVertexBufferObjectManager ()); Scene.attachChild (mTower1); Scene.attachChild (mTower2); Scene.attachChild (mTower3); Return view; }   

}

But getting the hello world on only the screen which is written in XML I have seen that onCreateResources () and onCreateScene () are not called. Should they be called explicitly?

Can anyone help me ??

Thanks in advance.

It seems that you have not typed all the parts of AndEngine together with my suggestion correctly That's what you start to know about doing so.

No comments:

Post a Comment