private void loadGraphicResourcesNearestPremultiplyAlpha() {
    atlasNearestPremultiplyAlpha =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            this.applyResizeFactor(sizeAtlasNearestPremultiplyAlpha.x),
            this.applyResizeFactor(sizeAtlasNearestPremultiplyAlpha.y),
            BitmapTextureFormat.RGBA_8888,
            TextureOptions.NEAREST_PREMULTIPLYALPHA);

    regionArrow =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearestPremultiplyAlpha,
            this.activity,
            "arrow_63x70.svg",
            this.applyResizeFactor(63),
            this.applyResizeFactor(70));

    regionIconPlay =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearestPremultiplyAlpha,
            this.activity,
            "icon_play_120x120.svg",
            this.applyResizeFactor(120),
            this.applyResizeFactor(120));

    regionBall =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearestPremultiplyAlpha,
            this.activity,
            "ball_172x172.svg",
            this.applyResizeFactor(172),
            this.applyResizeFactor(172));

    regionHeart =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearestPremultiplyAlpha,
            this.activity,
            "heart_100x80.svg",
            this.applyResizeFactor(100),
            this.applyResizeFactor(80));

    regionGameHeart =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearestPremultiplyAlpha,
            this.activity,
            "heart_100x80.svg",
            this.applyResizeFactor(63),
            this.applyResizeFactor(54));

    try {
      atlasNearestPremultiplyAlpha.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
              0, 0, applyResizeFactor(5)));
      atlasNearestPremultiplyAlpha.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadGraphicResourcesBilinearPremultiplyAlpha() {
    atlasBilinearPremultiplyAlpha =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            this.applyResizeFactor(sizeAtlasBilineaPremultiplyAlphar.x),
            this.applyResizeFactor(sizeAtlasBilineaPremultiplyAlphar.y),
            BitmapTextureFormat.RGBA_8888,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    regionGround =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinearPremultiplyAlpha,
            this.activity,
            "ground_1080x300.svg",
            this.applyResizeFactor(1080),
            this.applyResizeFactor(300));
    regionCicle38 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinearPremultiplyAlpha,
            this.activity,
            "circle.svg",
            this.applyResizeFactor(38),
            this.applyResizeFactor(38));
    regionCicle80 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinearPremultiplyAlpha,
            this.activity,
            "circle.svg",
            this.applyResizeFactor(80),
            this.applyResizeFactor(80));
    regionCoin50 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinearPremultiplyAlpha,
            this.activity,
            "coin_50x50.svg",
            this.applyResizeFactor(50),
            this.applyResizeFactor(50));

    regionRoundLock =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinearPremultiplyAlpha,
            this.activity,
            "roundlock_300x300.svg",
            this.applyResizeFactor(300),
            this.applyResizeFactor(300));

    try {
      atlasBilinearPremultiplyAlpha.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
              0, 0, applyResizeFactor(5)));
      atlasBilinearPremultiplyAlpha.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 3
0
  public void loadResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    TA =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            1024,
            1024,
            BitmapTextureFormat.RGBA_4444,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    map.loadResources(TA);

    creditsTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(TA, activity, "menu/credits.png");
    homeTR = BitmapTextureAtlasTextureRegionFactory.createFromAsset(TA, activity, "home.png");
    gamebyTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            TA, this.activity, "credits/game by.png");
    zarokhanTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            TA, this.activity, "credits/zarokhan.png");
    robinTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            TA, this.activity, "credits/robin.png");
    musicbyTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            TA, this.activity, "credits/music by.png");
    alexTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            TA, this.activity, "credits/alexander.png");

    font =
        FontFactory.create(
            this.activity.getFontManager(),
            this.activity.getTextureManager(),
            256,
            256,
            Typeface.create(Typeface.DEFAULT, Typeface.NORMAL),
            GameManager.lengthOfTile);
    font.load();

    try {
      TA.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(1, 1, 0));
      TA.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
Exemplo n.º 4
0
  public Sprite getMenuBackground() {
    mMenuBackgroundRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBuildableBitmapTextureAtlas, Game.getContext(), "menuback.png");
    try {
      mBuildableBitmapTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      mBuildableBitmapTextureAtlas.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
    mMenuBackgroundSprite =
        new Sprite(0, 0, mMenuBackgroundRegion, Game.getContext().getVertexBufferObjectManager());
    mMenuBackgroundSprite.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    mMenuBackgroundSprite.setAlpha(0.2f);

    return mMenuBackgroundSprite;
  }
Exemplo n.º 5
0
  public void loadResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");

    menuTA =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            1024,
            1024,
            BitmapTextureFormat.RGBA_4444,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    dodgecarsTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTA, this.activity, "dodgethecars.png");
    playTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(menuTA, this.activity, "play.png");
    highscoreTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTA, this.activity, "highscore.png");
    creditsTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTA, this.activity, "credits.png");

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    mapTA =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            1024,
            1024,
            BitmapTextureFormat.RGBA_4444,
            TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    carTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(mapTA, this.activity, "player.png");
    map.loadResources(mapTA);

    soundsOnTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mapTA, this.activity, "sound on.png");
    soundsOffTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mapTA, this.activity, "sound off.png");
    musicOnTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mapTA, this.activity, "music on.png");
    musicOffTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mapTA, this.activity, "music off.png");

    font =
        FontFactory.create(
            this.activity.getFontManager(),
            this.activity.getTextureManager(),
            256,
            256,
            Typeface.create(Typeface.DEFAULT, Typeface.NORMAL),
            32 * 3f);
    font.load();

    sounds.loadResources();

    try {
      menuTA.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
      menuTA.load();
      mapTA.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 1));
      mapTA.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadGraphicResourcesNearest() { // Default texture option
    atlasNearest =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            this.applyResizeFactor(sizeAtlasNearest.x),
            this.applyResizeFactor(sizeAtlasNearest.y),
            BitmapTextureFormat.RGBA_8888,
            TextureOptions.NEAREST);

    regionLoadingCircle =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearest,
            this.activity,
            "loading_circle_700x700.svg",
            this.applyResizeFactor(700),
            this.applyResizeFactor(700));

    regionMarketShareStar =
        SVGBitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.atlasNearest,
            this.activity,
            "market_share_star_btns_320x480.svg",
            this.applyResizeFactor(320),
            this.applyResizeFactor(480),
            2,
            3);

    regionButtonBg =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearest,
            this.activity,
            "button_bg_400x120.svg",
            this.applyResizeFactor(400),
            this.applyResizeFactor(120));

    regionLevelButtonAchievment =
        SVGBitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.atlasNearest,
            this.activity,
            "level_button_achievement_1x2_100x50.svg",
            this.applyResizeFactor(100),
            this.applyResizeFactor(50),
            2,
            1);

    regionCicle150 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearest,
            this.activity,
            "circle.svg",
            this.applyResizeFactor(150),
            this.applyResizeFactor(150));

    regionCicle225 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearest,
            this.activity,
            "circle.svg",
            this.applyResizeFactor(225),
            this.applyResizeFactor(225));

    regionPrickleV108x35 =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasNearest,
            this.activity,
            "prickleV108x35.svg",
            this.applyResizeFactor(108),
            this.applyResizeFactor(35));

    try {
      atlasNearest.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
              0, 0, applyResizeFactor(5)));
      atlasNearest.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
  private void loadGraphicResourcesBilinear() {
    atlasBilinear =
        new BuildableBitmapTextureAtlas(
            this.activity.getTextureManager(),
            this.applyResizeFactor(sizeAtlasBilinear.x),
            this.applyResizeFactor(sizeAtlasBilinear.y),
            BitmapTextureFormat.RGBA_8888,
            TextureOptions.BILINEAR);

    regionFinger =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinear,
            this.activity,
            "finger_139x126.svg",
            this.applyResizeFactor(139),
            this.applyResizeFactor(126));

    regionTank =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinear,
            this.activity,
            "tank_180x125.svg",
            this.applyResizeFactor(180),
            this.applyResizeFactor(125));

    regionLevelButtonBg =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinear,
            this.activity,
            "level_button_bg_453x100.svg",
            this.applyResizeFactor(453),
            this.applyResizeFactor(100));

    regionLevelButtonLevelBg =
        SVGBitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.atlasBilinear,
            this.activity,
            "level_button_level_bg_1x2_200x100.svg",
            this.applyResizeFactor(200),
            this.applyResizeFactor(100),
            2,
            1);

    regionArrowRight =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinear,
            this.activity,
            "arrowright_80x160.svg",
            this.applyResizeFactor(80),
            this.applyResizeFactor(160));

    regionTriangle =
        SVGBitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.atlasBilinear,
            this.activity,
            "play_35x42.svg",
            this.applyResizeFactor(35),
            this.applyResizeFactor(42));

    try {
      atlasBilinear.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(
              0, 0, applyResizeFactor(5)));
      atlasBilinear.load();
    } catch (TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }