@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;
  }
Ejemplo n.º 2
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");
  }
Ejemplo n.º 3
0
  @Override
  public void onLoadResources() {
    /* Load the font we are going to use. */
    FontFactory.setAssetBasePath("font/");
    this.mFontTexture = new BitmapTextureAtlas(512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mFont =
        FontFactory.createFromAsset(this.mFontTexture, this, "Plok.ttf", 32, true, Color.WHITE);

    this.mEngine.getTextureManager().loadTexture(this.mFontTexture);
    this.getFontManager().loadFont(this.mFont);

    /* Load all the textures this game needs. */
    this.mBitmapTextureAtlas =
        new BitmapTextureAtlas(128, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    this.mHeadTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.mBitmapTextureAtlas, this, "snake_head.png", 0, 0, 3, 1);
    this.mTailPartTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBitmapTextureAtlas, this, "snake_tailpart.png", 96, 0);
    this.mFrogTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.mBitmapTextureAtlas, this, "frog.png", 0, 64, 3, 1);

    this.mBackgroundTexture = new BitmapTextureAtlas(1024, 512, TextureOptions.DEFAULT);
    this.mBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBackgroundTexture, this, "snake_background.png", 0, 0);

    this.mOnScreenControlTexture =
        new BitmapTextureAtlas(256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    this.mOnScreenControlBaseTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mOnScreenControlTexture, this, "onscreen_control_base.png", 0, 0);
    this.mOnScreenControlKnobTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mOnScreenControlTexture, this, "onscreen_control_knob.png", 128, 0);

    this.mEngine
        .getTextureManager()
        .loadTextures(
            this.mBackgroundTexture, this.mBitmapTextureAtlas, this.mOnScreenControlTexture);

    /* Load all the sounds this game needs. */
    try {
      SoundFactory.setAssetBasePath("mfx/");
      this.mGameOverSound =
          SoundFactory.createSoundFromAsset(this.getSoundManager(), this, "game_over.ogg");
      this.mMunchSound =
          SoundFactory.createSoundFromAsset(this.getSoundManager(), this, "munch.ogg");
    } catch (final IOException e) {
      Debug.e(e);
    }
  }
Ejemplo n.º 4
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);
  }