当前位置: 首页>>代码示例>>Java>>正文


Java BuildableBitmapTextureAtlas类代码示例

本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas的典型用法代码示例。如果您正苦于以下问题:Java BuildableBitmapTextureAtlas类的具体用法?Java BuildableBitmapTextureAtlas怎么用?Java BuildableBitmapTextureAtlas使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BuildableBitmapTextureAtlas类属于org.andengine.opengl.texture.atlas.bitmap包,在下文中一共展示了BuildableBitmapTextureAtlas类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTextureRegion

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
private ITextureRegion getTextureRegion(String fileName, BuildableBitmapTextureAtlas bta) throws IOException {
	InputStream in = null;
	try {
		in = gameActivity.getResources().getAssets().open("gfx/" + fileName);
		return BitmapTextureAtlasTextureRegionFactory.createFromAsset(
				bta, gameActivity, fileName);
	} catch (IOException e) {
		IBitmapTextureAtlasSource ats = FileBitmapTextureAtlasSource.createFromInternalStorage(
				gameActivity, "/gfx/" + fileName, 0, 0);
		return BitmapTextureAtlasTextureRegionFactory.createFromSource(bta, ats);
	} finally {
		if (in != null) {
			in.close();
		}
	}
}
 
开发者ID:kyokomi,项目名称:AndEngineSRPGQuest,代码行数:17,代码来源:ResourceUtil.java

示例2: loadMenuGraphics

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
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);
	}
}
 
开发者ID:LHBDev,项目名称:MoonMiner,代码行数:18,代码来源:ResourcesManager.java

示例3: loadGameGraphics

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
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);
       }
}
 
开发者ID:LHBDev,项目名称:MoonMiner,代码行数:21,代码来源:ResourcesManager.java

示例4: loadMainMenuResources

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
/**
 * Loads the main menu resources.
 */
public synchronized void loadMainMenuResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");

    // Main Menu Ninja Trials Logo:
    if(mainTitle==null) {
        BitmapTextureAtlas mainTitleT = new BitmapTextureAtlas(
                this.textureManager, 756, 495, mTransparentTextureOption);
        mainTitle = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                mainTitleT, this.activity, "menu_main_title.png", 0, 0);
        mainTitleT.load();
    }

    // Main Menu Pattern:
    if (mainTitlePattern1 == null) {
        BuildableBitmapTextureAtlas mainTitlePattern1T = new BuildableBitmapTextureAtlas(
                this.textureManager, 400, 300, TextureOptions.REPEATING_BILINEAR);
        mainTitlePattern1 = BitmapTextureAtlasTextureRegionFactory
                .createFromAsset(mainTitlePattern1T, this.activity, "menu_main_pattern_1.png");
        try {
            mainTitlePattern1T.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
                    BitmapTextureAtlas>(0, 0, 0));
            mainTitlePattern1T.load();
        } catch (TextureAtlasBuilderException e) {
            Debug.e(e);
        }
    }
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:31,代码来源:ResourceManager.java

示例5: loadOptionResources

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
/**
 * Loads the main option menu resources.
 */
public synchronized void loadOptionResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");

    // Sound bars:
    BitmapTextureAtlas mainOptionsSoundBarsT = new BitmapTextureAtlas(this.textureManager, 575, 220,
            mTransparentTextureOption);
    BitmapTextureAtlasTextureRegionFactory.createFromAsset(mainOptionsSoundBarsT, this.activity,
            "menu_options_volume.png", 0, 0);
    mainOptionsSoundBarsT.load();
    mainOptionsSoundBarsActive = TextureRegionFactory.
            extractFromTexture(mainOptionsSoundBarsT, 0, 0, 575, 110, false);
    mainOptionsSoundBarsInactive = TextureRegionFactory.
            extractFromTexture(mainOptionsSoundBarsT, 0, 111, 575, 109, false);

    // Option Menu Pattern:
    if (mainOptionsPattern == null) {
        BuildableBitmapTextureAtlas mainOptionsPatternT = new BuildableBitmapTextureAtlas(
                this.textureManager, 390, 361, TextureOptions.REPEATING_BILINEAR);
        mainOptionsPattern = BitmapTextureAtlasTextureRegionFactory
                .createFromAsset(mainOptionsPatternT, this.activity, "menu_main_pattern_2.png");
        try {
            mainOptionsPatternT.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
                    BitmapTextureAtlas>(0, 0, 0));
            mainOptionsPatternT.load();
        } catch (TextureAtlasBuilderException e) {
            Debug.e(e);
        }
    }
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:33,代码来源:ResourceManager.java

示例6: loadControllerOptionResources

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
/**
 * Loads the main option menu resources.
 *     public static ITextureRegion controllerOuya;
public static ITextureRegion controllerMarks;
 */
public synchronized void loadControllerOptionResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/menus/");

    // Controller ouya:
    if(controllerOuya==null) {
        BitmapTextureAtlas controllerOuyaT = new BitmapTextureAtlas(this.textureManager, 1164, 791,
                mTransparentTextureOption);
        controllerOuya = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                controllerOuyaT, this.activity, "menu_options_controller_ouya.png", 0, 0);
        controllerOuyaT.load();
    }

    // Controller marks:
    if(controllerMarks==null) {
        BitmapTextureAtlas controllerMarksT = new BitmapTextureAtlas(this.textureManager, 1195, 717,
                mTransparentTextureOption);
        controllerMarks = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                controllerMarksT, this.activity, "menu_options_controller_marks.png", 0, 0);
        controllerMarksT.load();
    }

    // Controller Option Pattern:
    if (controllerOptionsPattern == null) {
        BuildableBitmapTextureAtlas controllerOptionsPatternT = new BuildableBitmapTextureAtlas(
                this.textureManager, 319, 319, TextureOptions.REPEATING_BILINEAR);
        controllerOptionsPattern = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                controllerOptionsPatternT, this.activity, "menu_main_pattern_3.png");
        try {
            controllerOptionsPatternT.build(
                    new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
                        BitmapTextureAtlas>(0, 0, 0));
            controllerOptionsPatternT.load();
        } catch (TextureAtlasBuilderException e) {
            Debug.e(e);
        }
    }
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:43,代码来源:ResourceManager.java

示例7: loadEndingResources

import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas; //导入依赖的package包/类
public synchronized void loadEndingResources() {
    BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/endings/");
    if (endingCreditsBackground == null) {
        BitmapTextureAtlas endingCreditsBackgroundT = new BitmapTextureAtlas(this.textureManager,
                1920, 1080, mTransparentTextureOption);
        endingCreditsBackground = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingCreditsBackgroundT, this.activity, "ending_credits_background.png", 0, 0);
        endingCreditsBackgroundT.load();
    }
    if (endingCreditsCategories == null) {
        BuildableBitmapTextureAtlas endingCredCategBit = new BuildableBitmapTextureAtlas(
                this.textureManager, 1200, 1020, mTransparentTextureOption);
        endingCreditsCategories = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
                endingCredCategBit, this.context, "ending_credits_categories.png", 3, 3);
        try {
            endingCredCategBit.build(new BlackPawnTextureAtlasBuilder<IBitmapTextureAtlasSource,
                    BitmapTextureAtlas>(0, 0, 0));
        }
        catch (TextureAtlasBuilderException e) {
            e.printStackTrace();
        }
        endingCredCategBit.load();
    }
    if (endingCreditsLogoAndengine == null) {
        BitmapTextureAtlas endingCreditsLogoAndengineT = new BitmapTextureAtlas(this.textureManager, 389, 389,
                mTransparentTextureOption);
        endingCreditsLogoAndengine = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingCreditsLogoAndengineT, this.activity, "ending_credits_logo_andengine.png", 0, 0);
        endingCreditsLogoAndengineT.load();
    }
    if (endingCreditsLogoEstudioevergreen == null) {
        BitmapTextureAtlas endingCreditsLogoEstudioevergreenT = new BitmapTextureAtlas(this.textureManager, 389, 389,
                mTransparentTextureOption);
        endingCreditsLogoEstudioevergreen = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingCreditsLogoEstudioevergreenT, this.activity, "ending_credits_logo_estudioevergreen.png", 0, 0);
        endingCreditsLogoEstudioevergreenT.load();
    }
    if (endingRyokoEasyBg == null) {
        BitmapTextureAtlas endingRyokoEasyBgT = new BitmapTextureAtlas(this.textureManager, 1920, 1080,
                mTransparentTextureOption);
        endingRyokoEasyBg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingRyokoEasyBgT, this.activity, "ending_ryoko_easy_bg.png", 0, 0);
        endingRyokoEasyBgT.load();
    }
    if (endingRyokoEasy == null) {
        BitmapTextureAtlas endingRyokoEasyT = new BitmapTextureAtlas(this.textureManager, 633, 989,
                mTransparentTextureOption);
        endingRyokoEasy = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingRyokoEasyT, this.activity, "ending_ryoko_easy.png", 0, 0);
        endingRyokoEasyT.load();
    }
    if (endingShoEasyBg == null) {
        BitmapTextureAtlas endingShoEasyBgT = new BitmapTextureAtlas(this.textureManager, 1920, 1080,
                mTransparentTextureOption);
        endingShoEasyBg = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingShoEasyBgT, this.activity, "ending_sho_easy_bg.png", 0, 0);
        endingShoEasyBgT.load();
    }
    if (endingShoEasy == null) {
        BitmapTextureAtlas endingShoEasyT = new BitmapTextureAtlas(this.textureManager, 813, 1049,
                mTransparentTextureOption);
        endingShoEasy = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
                endingShoEasyT, this.activity, "ending_sho_easy.png", 0, 0);
        endingShoEasyT.load();
    }
}
 
开发者ID:jjhaggar,项目名称:ninja-trials,代码行数:67,代码来源:ResourceManager.java


注:本文中的org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。