0

Hi Whenever I use this code it produces a triangle in the upper right corner of my android device, anything I'm missing? thanks.

Do I have to add anything special in my onCreateScene etc.

My onCreateResources:

@Override
public void onCreateResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    this.mBitmapTextureAtlas = new BitmapTextureAtlas(
            this.getTextureManager(), 64, 256,
            TextureOptions.NEAREST_PREMULTIPLYALPHA);

    this.mPenguinTexture = BitmapTextureAtlasTextureRegionFactory
            .createTiledFromAsset(this.mBitmapTextureAtlas, this,
                    "penguintiled.png", 0, 0, 1, 2); // 64x32

    BitmapTextureAtlas lolz = new BitmapTextureAtlas(
            this.getTextureManager(), 128, 128, TextureOptions.NEAREST_PREMULTIPLYALPHA); 

    mIcicleTextureRegion = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(lolz, this, "icicle.png", 0, 0);

    mTwoIcicleTextureRegion = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(lolz, this, "twoice.png", 32, 32);

    this.mAutoParallaxBackgroundTexture = new BitmapTextureAtlas(
            this.getTextureManager(), 2048, 2048);

    this.mParallaxLayerFront = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(this.mAutoParallaxBackgroundTexture, this,
                    "frontbg.png", 0, 0);

    this.mParallaxLayerBack = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(this.mAutoParallaxBackgroundTexture, this,
                    "mountains.png", 0, 188);

    this.mParallaxLayerMid = BitmapTextureAtlasTextureRegionFactory
            .createFromAsset(this.mAutoParallaxBackgroundTexture, this,
                    "cloud.png", 0, 669);

    this.mCoinAtlas = new BitmapTextureAtlas(
            this.getTextureManager(), 128, 32, TextureOptions.BILINEAR);

    this.mCoinTex = BitmapTextureAtlasTextureRegionFactory
            .createTiledFromAsset(mCoinAtlas, this, "coinsheet.png", 0, 0, 4, 1);

    this.mAutoParallaxBackgroundTexture.load();
    this.mCoinAtlas.load();
    this.mBitmapTextureAtlas.load();
    lolz.load();

    mFontTexture = new BitmapTextureAtlas(this.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    mFont = FontFactory.createFromAsset(this.getFontManager(), this.getTextureManager(), 256, 256, this.getAssets(),
            "fnt/lol.ttf", 46, true, android.graphics.Color.BLACK);
    getEngine().getTextureManager().loadTexture(mFontTexture);
    mFont.load();

    try
    {
        beep = SoundFactory.createSoundFromAsset(mEngine.getSoundManager(), this,"sfx/coinbeep.mp3");
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }

}
user1118321
  • 25,567
  • 4
  • 55
  • 86

1 Answers1

0

If you are extending BaseGameActivity class, I suggest you extending SimpleBaseGameActivity instead. I think your problem is about this. For example;

public class GameActivity extends SimpleBaseGameActivity {

    private Camera camera;
    private Scene scene;
    @Override
    public EngineOptions onCreateEngineOptions() {

        camera = new Camera(0, 0, 800, 480);
        EngineOptions engineOptions = new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(800, 480), camera);

        return engineOptions;
    }

    @Override
    protected void onCreateResources() {

        // load your resources here
    }

    @Override
    protected Scene onCreateScene() {

        // attach your sprites, etc...

        return scene;
    }
}

In this way you won't struggle with complicated methods and callbacks, hope it solves your issue.

mhmtemnacr
  • 185
  • 3
  • 18