@Override
  public void onLoadResources() {
    /* Load Font/Textures. */
    this.mFontTexture = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    FontFactory.setAssetBasePath("font/");
    this.mFont =
        FontFactory.createFromAsset(this.mFontTexture, this, "Flubber.ttf", 32, true, Color.WHITE);
    this.mEngine.getTextureManager().loadTexture(this.mFontTexture);
    this.mEngine.getFontManager().loadFont(this.mFont);

    this.mMenuBackTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mMenuBackTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mMenuBackTexture, this, "gfx/MainMenu/MainMenuBk.png", 0, 0);
    this.mEngine.getTextureManager().loadTexture(this.mMenuBackTexture);

    this.mPopUpTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mPopUpAboutTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mPopUpTexture, this, "gfx/MainMenu/About_button.png", 0, 0);
    this.mPopUpQuitTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mPopUpTexture, this, "gfx/MainMenu/Quit_button.png", 0, 50);
    this.mEngine.getTextureManager().loadTexture(this.mPopUpTexture);
    popupDisplayed = false;
  }
Esempio n. 2
0
 @Override
 public void onLoadResources() {
   this.mTexture = new Texture(64, 64, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
   TextureRegionFactory.setAssetBasePath("gfx/");
   this.mBoxFaceTextureRegion =
       TextureRegionFactory.createTiledFromAsset(
           this.mTexture, this, "face_box_tiled.png", 0, 0, 2, 1); // 64x32
   this.mCircleFaceTextureRegion =
       TextureRegionFactory.createTiledFromAsset(
           this.mTexture, this, "face_circle_tiled.png", 0, 32, 2, 1); // 64x32
   this.mEngine.getTextureManager().loadTexture(this.mTexture);
 }
 @Override
 public void onLoadResources() {
   mTexture = new Texture(64, 64, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
   TextureRegionFactory.setAssetBasePath("gfx/");
   mBoxFaceTextureRegion =
       TextureRegionFactory.createTiledFromAsset(mTexture, this, "face_box_tiled.png", 0, 0, 2, 1);
   mCircleFaceTextureRegion =
       TextureRegionFactory.createTiledFromAsset(
           mTexture, this, "face_circle_tiled.png", 0, 32, 2, 1);
   getEngine().getTextureManager().loadTexture(mTexture);
   enableAccelerometerSensor(this);
 }
Esempio n. 4
0
  public List<Texture> loadRessources(BaseGameActivity parent) {
    TextureRegionFactory.setAssetBasePath("gfx/");

    this.mLevelTexture = new Texture(512, 512, TextureOptions.REPEATING_BILINEAR_PREMULTIPLYALPHA);
    this.mLevelTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mLevelTexture, parent, "levelfirststrike.png", 0, 0);
    this.textureList.add(mLevelTexture);

    this.mBoxTexture = new Texture(32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mBoxTextureRegion =
        TextureRegionFactory.createFromAsset(this.mBoxTexture, parent, "box.png", 0, 0);
    this.textureList.add(mBoxTexture);

    return this.textureList;
  }
Esempio n. 5
0
  public void reloadBall() {

    this.mBallTexture.clearTextureSources();
    this.mBallTextureRegion =
        TextureRegionFactory.createTiledFromAsset(
            this.mBallTexture, this, "Basketball_Ball_48.png", 0, 0, 1, 1);
  }
Esempio n. 6
0
  @Override
  public void onLoadResources() {
    /* Load Font/Textures. */
    this.mFontTexture = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    FontFactory.setAssetBasePath("font/");
    this.mFont =
        FontFactory.createFromAsset(
            this.mFontTexture, getApplicationContext(), "Flubber.ttf", 32, true, Color.WHITE);
    this.mEngine.getTextureManager().loadTexture(this.mFontTexture);
    this.mEngine.getFontManager().loadFont(this.mFont);

    this.mMenuBackTexture = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mMenuBackTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mMenuBackTexture,
            getApplicationContext(),
            "gfx/OptionsMenu/OptionsMenuBk.png",
            0,
            0);
    this.mEngine.getTextureManager().loadTexture(this.mMenuBackTexture);

    mTurnMusicOn = new TextMenuItem(MENU_MUSIC, mFont, "Turn Music On");
    mTurnMusicOff = new TextMenuItem(MENU_MUSIC, mFont, "Turn Music Off");
    mTurnEffectsOn = new TextMenuItem(MENU_EFFECTS, mFont, "Turn Effects On");
    mTurnEffectsOff = new TextMenuItem(MENU_EFFECTS, mFont, "Turn Effects Off");

    mWAV = new TextMenuItem(MENU_WAV, mFont, "Whack A Vampire");
  }
  public void onLoadResources() {
    txtLogo = new Texture(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    txtrLogo = TextureRegionFactory.createFromAsset(txtLogo, this, Data.IMG_BF_LOGO_PATH, 0, 0);

    mEngine.getTextureManager().loadTexture(txtLogo);
  }
Esempio n. 8
0
  @Override
  public void onLoadResources() {
    this.mTexture = new Texture(32, 32, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mFaceTextureRegion =
        TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/face_box.png", 0, 0);

    this.mEngine.getTextureManager().loadTexture(this.mTexture);
  }
 @Override
 public void onLoadResources() {
   mIconTexture = new BuildableTexture(128, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
   mIconTextureRegion = TextureRegionFactory.createFromAsset(this.mIconTexture, this, "icon.png");
   try {
     mIconTexture.build(new BlackPawnTextureBuilder(2));
   } catch (final TextureSourcePackingException e) {
     Log.d(tag, "Sprites won't fit in mIconTexture");
   }
   this.mEngine.getTextureManager().loadTexture(this.mIconTexture);
 }
 public static TextureRegion createFromSource(
     final BitmapTextureAtlas pBitmapTextureAtlas,
     final IBitmapTextureAtlasSource pBitmapTextureAtlasSource,
     final int pTexturePositionX,
     final int pTexturePositionY) {
   return TextureRegionFactory.createFromSource(
       pBitmapTextureAtlas,
       pBitmapTextureAtlasSource,
       pTexturePositionX,
       pTexturePositionY,
       sCreateTextureRegionBuffersManaged);
 }
Esempio n. 11
0
  @Override
  public void onLoadResources() {
    this.mTexture =
        new Texture(
            128,
            128,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA,
            new ITextureStateListener.TextureStateAdapter() {
              @Override
              public void onTextureSourceLoadExeption(
                  final Texture pTexture,
                  final ITextureSource pTextureSource,
                  final Throwable pThrowable) {
                ImageFormatsExample.this.runOnUiThread(
                    new Runnable() {
                      @Override
                      public void run() {
                        Toast.makeText(
                                ImageFormatsExample.this,
                                "Failed loading TextureSource: " + pTextureSource.toString(),
                                Toast.LENGTH_LONG)
                            .show();
                      }
                    });
              }
            });

    this.mPngTextureRegion =
        TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/imageformat_png.png", 0, 0);
    this.mJpgTextureRegion =
        TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/imageformat_jpg.jpg", 49, 0);
    this.mGifTextureRegion =
        TextureRegionFactory.createFromAsset(this.mTexture, this, "gfx/imageformat_gif.gif", 0, 49);
    this.mBmpTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mTexture, this, "gfx/imageformat_bmp.bmp", 49, 49);

    this.mEngine.getTextureManager().loadTexture(this.mTexture);
  }
Esempio n. 12
0
  @Override
  public void onLoadResources() {
    super.onLoadResources();
    this.mBackGroundTextureRegion =
        TextureRegionFactory.createFromAsset(
            this.mBackgroundTexture, this, "basketball_court.jpg", 0, 0);
    this.mMenuFontTexture = new Texture(256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mMenuFont =
        FontFactory.createFromAsset(
            this.mMenuFontTexture, this, "VeraBd.ttf", 36, true, Color.WHITE);

    this.mEngine.getTextureManager().loadTextures(this.mBackgroundTexture, this.mMenuFontTexture);
    this.mEngine.getFontManager().loadFont(this.mMenuFont);
  }
 public static TiledTextureRegion createTiledFromSource(
     final BitmapTextureAtlas pBitmapTextureAtlas,
     final IBitmapTextureAtlasSource pBitmapTextureAtlasSource,
     final int pTexturePositionX,
     final int pTexturePositionY,
     final int pTileColumns,
     final int pTileRows) {
   return TextureRegionFactory.createTiledFromSource(
       pBitmapTextureAtlas,
       pBitmapTextureAtlasSource,
       pTexturePositionX,
       pTexturePositionY,
       pTileColumns,
       pTileRows,
       sCreateTextureRegionBuffersManaged);
 }