示例#1
0
  @Override
  protected void onCreateResources() throws IOException {
    this.gameManager = GomokuGameManager.getInstance();
    this.gameManager.setCallback(this);
    this.gameManager.initialize(COLUMNS - 1, ROWS - 1);
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    this.mBitmapTextureAtlas = new BuildableBitmapTextureAtlas(this.getTextureManager(), 512, 512);
    this.blankRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBitmapTextureAtlas, this, "blankIcon.png");
    this.xRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBitmapTextureAtlas, this, "xIcon.png");
    this.oRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBitmapTextureAtlas, this, "oIcon.png");
    this.winRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mBitmapTextureAtlas, this, "blueIcon.png");
    try {
      this.mBitmapTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 1));
      this.mBitmapTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
 @Override
 public void onCreateResourcesAsync(final IProgressListener pProgressListener) throws Exception {
   pProgressListener.onProgressChanged(0);
   Thread.sleep(1000);
   pProgressListener.onProgressChanged(20);
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
   Thread.sleep(1000);
   this.mBitmapTextureAtlas =
       new BitmapTextureAtlas(this.getTextureManager(), 32, 32, TextureOptions.BILINEAR);
   pProgressListener.onProgressChanged(40);
   Thread.sleep(1000);
   this.mFaceTextureRegion =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           AsyncGameActivityExample.this.mBitmapTextureAtlas,
           AsyncGameActivityExample.this,
           "face_box.png",
           0,
           0);
   pProgressListener.onProgressChanged(60);
   Thread.sleep(1000);
   this.mBitmapTextureAtlas.load();
   pProgressListener.onProgressChanged(80);
   Thread.sleep(1000);
   pProgressListener.onProgressChanged(100);
 }
示例#3
0
  @Override
  public void loadScene() {

    menuTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    menu_background_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_background.png");
    play_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "play.png");
    options_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "options.png");

    try {
      this.menuTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));

    } catch (TextureAtlasBuilderException e) {
      Debug.e(e);
    }
    this.menuTextureAtlas.load();
  }
  public ITextureRegion loadImageResourceFromSD(
      String nameResource,
      BitmapTextureAtlas pBitmapTextureAtlas,
      int pTexturePositionX,
      int pTexturePositionY) {

    if (BuildConfig.TEST_VERSION) {
      return BitmapTextureAtlasTextureRegionFactory.createFromAsset(
          pBitmapTextureAtlas, getActivity(), nameResource, pTexturePositionX, pTexturePositionY);
    } else {
      String path =
          Environment.getExternalStorageDirectory()
              + "/Android/data/"
              + getActivity().getPackageName()
              + "/files/"
              + songName
              + "/gfx/"
              + nameResource
              + ".nomedia";
      File tmp = new File(path);
      if (!tmp.exists()) {
        return null;
      }
      return BitmapTextureAtlasTextureRegionFactory.createFromSource(
          pBitmapTextureAtlas,
          FileBitmapTextureAtlasSource.create(tmp),
          pTexturePositionX,
          pTexturePositionY);
    }
  }
  public void onCreateResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    this.mBitmapTextureAtlas = new BitmapTextureAtlas(this.getTextureManager(), 512, 512);
    mBotonTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBitmapTextureAtlas, this, "botontuto.png", 0, 0);
    this.mBitmapTextureAtlas.load();
  }
示例#6
0
 // ------------------------------------------------------------------------------------
 // CLASS LOGIC
 // -------------------------------------------------------------------------------------
 public void loadSplashScreen() {
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
   splashTextureAtlas =
       new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
   splash_region =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           splashTextureAtlas, activity, "splash.png", 0, 0);
   splashTextureAtlas.load();
 }
示例#7
0
  public void loadSplashResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    splashTA = new BitmapTextureAtlas(activity.getTextureManager(), 256, 256);

    splashTR =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            splashTA, activity, "splash12.png", 0, 0);

    splashTA.load();
  }
示例#8
0
 private void initControlResources() {
   this.mOnScreenControlTexture =
       new BitmapTextureAtlas(this.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
   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.mOnScreenControlTexture.load();
 }
  public void loadSplashResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(
        ResourceManager.AssetFolders.Images + "/" + ResourceManager.ImageFolders.Textures + "/");
    splashTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 1024, 512);
    splashTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            splashTextureAtlas, activity, "splash_bg.png", 0, 0);
    splashTextureAtlas.load();
    backgroundSprite =
        new Sprite(0, 0, splashTextureRegion, vertexBufferObjectManager) {
          @Override
          protected void preDraw(GLState pGLState, Camera pCamera) {
            super.preDraw(pGLState, pCamera);
            pGLState.enableDither();
          }
        };
    float width = camera.getWidth();
    float height = camera.getHeight();
    backgroundSprite.setPosition(width / 2, height / 2);
    backgroundSprite.setSize(width, height);

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(
        ResourceManager.AssetFolders.Images
            + "/"
            + ResourceManager.ImageFolders.TiledTextures
            + "/");
    spinnerTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 1398, 128);
    spinnerTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            spinnerTextureAtlas, activity, "android_loading.png", 0, 0, 8, 1);
    spinnerTextureAtlas.load();
    spinner =
        new AnimatedSprite(width / 2, height / 2, spinnerTextureRegion, vertexBufferObjectManager);
    spinner.setZIndex(10);
    spinner.animate(200);

    FontFactory.setAssetBasePath(ResourceManager.AssetFolders.Fonts + "/");
    ITexture fontTexture2 =
        new BitmapTextureAtlas(activity.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
    textFont =
        FontFactory.createStrokeFromAsset(
            activity.getFontManager(),
            fontTexture2,
            activity.getAssets(),
            "OpenSans-Regular.ttf",
            25,
            true,
            Color.WHITE,
            1,
            Color.rgb(70, 70, 70));
    textFont.load();
  }
示例#10
0
  @Override
  protected void onCreateResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

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

    this.mParticleTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBitmapTextureAtlas, this, "particle_point.png", 0, 0);

    this.mBitmapTextureAtlas.load();
  }
  public void loadLoadingResources() {
    if (loadingTextureAtlas != null) {
      loadingTextureAtlas.load();
      return;
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/loading/");
    loadingTextureAtlas =
        new BitmapTextureAtlas(activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
    loadingTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            loadingTextureAtlas, activity, "background.png", 0, 0);
    loadingTextureAtlas.load();
  }
示例#12
0
  @Override
  protected void loadResources() {
    super.loadResources();

    this.loadFont();

    BitmapTextureAtlas bitmapTextureAtlas =
        new BitmapTextureAtlas(
            getTextureManager(), 1024, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    textureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            bitmapTextureAtlas, this, "bulles.png", 0, 0, 10, 1);
    bitmapTextureAtlas.load();

    BitmapTextureAtlas bitmapTextureAtlasScore =
        new BitmapTextureAtlas(
            getTextureManager(), 1024, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    textureRegionScore =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            bitmapTextureAtlasScore, this, "background_brown.png", 0, 0, 1, 1);
    bitmapTextureAtlasScore.load();

    BitmapTextureAtlas bitmapTextureAtlasExplosione =
        new BitmapTextureAtlas(
            getTextureManager(), 1024, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    textureRegionExplosion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            bitmapTextureAtlasExplosione, this, "explosion.png", 0, 0, 7, 7);
    bitmapTextureAtlasExplosione.load();

    BitmapTextureAtlas bitmapTextureAtlasPlate =
        new BitmapTextureAtlas(
            getTextureManager(), 512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    plateTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            bitmapTextureAtlasPlate, this, "plate.png", 0, 0, 1, 1);
    bitmapTextureAtlasPlate.load();

    BitmapTextureAtlas bitmapTextureAtlasHeader =
        new BitmapTextureAtlas(
            getTextureManager(), 512, 512, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    headerTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            bitmapTextureAtlasHeader, this, "header_background.png", 0, 0, 1, 1);
    bitmapTextureAtlasHeader.load();

    if (null != this.getIntent().getExtras())
      animated = this.getIntent().getExtras().getBoolean("ANIMATED");
  }
示例#13
0
  @Override
  protected void onCreateResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
    this.mBitmapTextureAtlas2 =
        new BitmapTextureAtlas(this.getTextureManager(), 32, 32, TextureOptions.BILINEAR);
    this.mFaceTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBitmapTextureAtlas2, this, "face_box.png", 0, 0);
    this.mBitmapTextureAtlas2.load();

    // Load resoure player
    loadResourePlayer();

    //
  }
示例#14
0
  @Override
  protected void onCreateResources() throws IOException { // #2
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(
        "gfx/"); // indicamos donde están las imágenes
    myAtlas =
        new BitmapTextureAtlas(
            getTextureManager(),
            1000,
            1000,
            TextureOptions.DEFAULT); // Atlas lugar en memoria donde estaran las iamgenes
    celdaTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            myAtlas, this, "celda.png", 0, 0); // ubicamos la imagen en el atlas

    myAtlas.load();
  }
示例#15
0
 public void onCreateResources() {
   // nothing
   SoundFactory.setAssetBasePath(getBasePathFolder() + "/mfx/");
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath(getBasePathFolder() + "/gfx/");
   mTexturePackLoaderFromSource =
       new TexturePackLoaderFromSource(this.getTextureManager(), pAssetManager, "santa/gfx/");
 }
示例#16
0
文件: Tree.java 项目: haaja/hackoid
 public void createResources(Main main) {
   textureAtlas =
       new BitmapTextureAtlas(main.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
   textureRegion =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           textureAtlas, main, "object_tree.png", 0, 0);
   textureAtlas.load();
 }
  private void loadAboutGraphics() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/about/");
    aboutTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    aboutBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            aboutTextureAtlas, activity, "background.jpg");

    try {
      aboutTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      aboutTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
示例#18
0
 @Override
 public void onCreateResources() {
   SoundFactory.setAssetBasePath("ohanashi/mfx/"); // Sound Resources
   MusicFactory.setAssetBasePath("ohanashi/mfx/");
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("ohanashi/gfx/"); // Image
   mTexturePackLoaderFromSource =
       new TexturePackLoaderFromSource(getTextureManager(), pAssetManager, "ohanashi/gfx/");
   super.onCreateResources();
 }
示例#19
0
 @Override
 protected void loadResourcesImpl() {
   mBgTextureRegion =
       AEUtils.createTextureRegionFromAssets("gfx/storm_flush_bg.png", mBaseActivity);
   mFont = AEUtils.createGameFont(mBaseActivity);
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
   mItemTexture =
       new BitmapTextureAtlas(this.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
   mLocTextureRegion =
       BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
           mItemTexture, mBaseActivity, "item_names.png", 0, 0, 1, 3);
   mMessageBox =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           mItemTexture, mBaseActivity, "msg_storm_flush.png", 0, 80);
   mBgTextureRegion.getTexture().load();
   mItemTexture.load();
   mFont.load();
 }
示例#20
0
  public void loadResourePlayer() {
    this.mBitmapTextureAtlas =
        new BitmapTextureAtlas(this.getTextureManager(), 72, 128, TextureOptions.DEFAULT);
    this.mPlayerTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.mBitmapTextureAtlas, this, "player.png", 0, 0, 3, 4);

    this.mBitmapTextureAtlas.load();
  }
示例#21
0
  @Override
  public void onCreateResources() {
    // Set the texture base path
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("sprites/");

    // Set the TextrueAtlas size
    //		this.mBitmapTextureAtlas = new BitmapTextureAtlas(256, 256, TextureOptions.NEAREST);
    this.mBitmapTextureAtlas = new BitmapTextureAtlas(256, 256, TextureOptions.BILINEAR);
    this.mBitmapJumpTextureAtlas = new BitmapTextureAtlas(256, 256, TextureOptions.BILINEAR);

    // Set the region and specific sprite
    this.mMarioTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.mBitmapTextureAtlas, this, "mario_walk.png", 0, 0, 3, 2);
    this.mMarioJumpTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            this.mBitmapJumpTextureAtlas, this, "mario_jump.png", 0, 0, 1, 2);
    this.mEngine.getTextureManager().loadTexture(mBitmapTextureAtlas);
  }
  private void setAssetBasePath() {
    int cameraWidth;
    setSvgAssetBasePath("svg/");

    cameraWidth = (int) camera.getWidth();
    switch (cameraWidth) {
      case 480:
        BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx480/");
        break;
      case 720:
        BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx720/");
        break;
      case 1080:
        BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx1080/");
        break;
      default:
        BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx720/");
        Log.v("assetPathErro", "SomethingWrong~");
        break;
    }
  }
示例#23
0
  @Override
  public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback)
      throws Exception {
    // TODO Auto-generated method stub

    this.mFontTexture =
        new BitmapTextureAtlas(
            this.getTextureManager(), 256, 256, TextureOptions.BILINEAR_PREMULTIPLYALPHA);

    FontFactory.setAssetBasePath("font/");
    mFont =
        FontFactory.createFromAsset(
            this.getFontManager(),
            this.mFontTexture,
            this.getAssets(),
            "texas.ttf",
            60.0f,
            true,
            Color.BLACK);
    mFont.load();

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    texBanana =
        new BitmapTextureAtlas(
            this.getTextureManager(), 256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
    regBanana =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            texBanana, this.getAssets(), "spr_banana.png", 0, 0, SPR_COLUMN, SPR_ROWS);
    texBanana.load();

    mMenuTexture =
        new BitmapTextureAtlas(this.getTextureManager(), 1024, 512, TextureOptions.BILINEAR);
    mMenuTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            mMenuTexture, this.getAssets(), "menu.png", 0, 0);
    mMenuTexture.load();

    pOnCreateResourcesCallback.onCreateResourcesFinished();
  }
示例#24
0
  private void loadGameGraphics() {

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/game/");
    gameTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(),
            1024,
            1024,
            TextureOptions.REPEATING_NEAREST_PREMULTIPLYALPHA);
    rockTop_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "Red_Rock_Top.png");
    rockMid_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "Red_Rock_Middle.png");
    rockOre_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "Ore_Rock.png");
    player_region =
        BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
            gameTextureAtlas, activity, "player.png", 1, 1);
    dpad_region =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            gameTextureAtlas, activity, "Dpad_Notpressed.png");
    try {
      this.gameTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 0));
      this.gameTextureAtlas.load();
    } catch (final TextureAtlasBuilderException e) {
      Debug.e(e);
    }
  }
  private void loadHighScoreGraphics() {
    if (recordTextureAtlas != null) {
      recordTextureAtlas.load();
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/highscore/");

    recordTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 512, TextureOptions.BILINEAR);
    recordBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            recordTextureAtlas, activity, "background.png");

    try {
      recordTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 0));
      recordTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }
示例#26
0
 private void loadMenuGraphics() {
   BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
   menuTextureAtlas =
       new BuildableBitmapTextureAtlas(
           activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);
   menu_background_region =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           menuTextureAtlas, activity, "menu_background.png");
   play_region =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           menuTextureAtlas, activity, "play.png");
   options_region =
       BitmapTextureAtlasTextureRegionFactory.createFromAsset(
           menuTextureAtlas, activity, "options.png");
   try {
     this.menuTextureAtlas.build(
         new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 1, 0));
     this.menuTextureAtlas.load();
   } catch (final TextureAtlasBuilderException e) {
     Debug.e(e);
   }
 }
示例#27
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();
    }
  }
示例#28
0
  @Override
  public void onCreateResources(OnCreateResourcesCallback pOnCreateResourcesCallback)
      throws Exception {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

    this.mBitmapTextureAtlas =
        new BitmapTextureAtlas(this.getTextureManager(), 32, 32, TextureOptions.BILINEAR);
    this.mFaceTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            this.mBitmapTextureAtlas, this, "face_box.png", 0, 0);
    this.mBitmapTextureAtlas.load();

    this.mOnScreenControlTexture =
        new BitmapTextureAtlas(this.getTextureManager(), 256, 128, TextureOptions.BILINEAR);
    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.mOnScreenControlTexture.load();

    pOnCreateResourcesCallback.onCreateResourcesFinished();
  }
示例#29
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;
  }
  private void loadMainMenuGraphics() {

    if (menuTextureAtlas != null) {
      menuTextureAtlas.load();
      return;
    }

    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menu/");
    menuTextureAtlas =
        new BuildableBitmapTextureAtlas(
            activity.getTextureManager(), 1024, 1024, TextureOptions.BILINEAR);

    menuBackgroundTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "background.jpg");
    buttonAboutTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_help.png");
    buttonExitTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_exit.png");
    buttonNewGameTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_new.png");
    buttonOptionsTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_options.png");
    buttonHighScoreTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_high.png");
    buttonMultiplayerTextureRegion =
        BitmapTextureAtlasTextureRegionFactory.createFromAsset(
            menuTextureAtlas, activity, "menu_multiplayer.png");

    try {
      menuTextureAtlas.build(
          new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource, BitmapTextureAtlas>(0, 0, 1));
      menuTextureAtlas.load();
    } catch (ITextureAtlasBuilder.TextureAtlasBuilderException e) {
      e.printStackTrace();
    }
  }