本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset方法的具体用法?Java BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset怎么用?Java BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory
的用法示例。
在下文中一共展示了BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadGameGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
private void loadGameGraphics() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
this.bitmapTextureAtlas_panda = new BitmapTextureAtlas(activity.getTextureManager(), panda_width, panda_height, TextureOptions.BILINEAR);
this.tiledTextureRegion_panda = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.bitmapTextureAtlas_panda, activity, "panda.png", 0, 0, 1, 8);
this.bitmapTextureAtlas_panda.load();
this.bitmapTextureAtlas_pipe1 = new BitmapTextureAtlas(activity.getTextureManager(), pipe_width, pipe_height,TextureOptions.BILINEAR);
this.textureRegion_pipe1 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_pipe1, activity, "column.png", 0, 0);
this.bitmapTextureAtlas_pipe1.load();
this.bitmapTextureAtlas_pipe2 = new BitmapTextureAtlas(activity.getTextureManager(), pipe_width, pipe_height, TextureOptions.BILINEAR);
this.textureRegion_pipe2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_pipe2, activity, "column1.png", 0, 0);
this.bitmapTextureAtlas_pipe2.load();
this.bitmapTextureAtlas_game_over = new BitmapTextureAtlas(activity.getTextureManager(), game_over_width, game_over_height , TextureOptions.BILINEAR);
this.textureRegion_game_over = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_game_over, activity, "gameover.png", 0, 0);
this.bitmapTextureAtlas_game_over.load();
this.bitmapTextureAtlas_scrore_board = new BitmapTextureAtlas(activity.getTextureManager(), score_board_width, score_board_height, TextureOptions.BILINEAR);
this.textureRegion_score_board = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_scrore_board, activity, "score.png", 0, 0);
this.bitmapTextureAtlas_scrore_board.load();
}
示例2: getTiledTextureRegion
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
private TiledTextureRegion getTiledTextureRegion(String fileName, BitmapTextureAtlas bta, int column, int row) throws IOException {
InputStream in = null;
try {
in = gameActivity.getResources().getAssets().open("gfx/" + fileName);
return BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(
bta, gameActivity, fileName, 0, 0, column, row);
} catch (IOException e) {
IBitmapTextureAtlasSource ats = FileBitmapTextureAtlasSource.createFromInternalStorage(
gameActivity, "/gfx/" + fileName, 0, 0);
return BitmapTextureAtlasTextureRegionFactory.createTiledFromSource(
bta, ats, 0, 0, column, row);
} finally {
if (in != null) {
in.close();
}
}
}
示例3: loadGameGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的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);
}
}
示例4: loadSplashScene
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
protected void loadSplashScene() {
checkSetGFXPath();
BitmapTextureAtlas splashTextureAtlas = new BitmapTextureAtlas(textureManager, 1440, 2400, TextureOptions.BILINEAR);
TiledTextureRegion splashTextureRegion = BitmapTextureAtlasTextureRegionFactory.
createTiledFromAsset(splashTextureAtlas, this, ResMan.SPLASH, 0, 0, 1, 1);
splashTextureAtlas.load();
putTexture(ResMan.SPLASH, splashTextureRegion);
}
示例5: loadMenus
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
protected void loadMenus() {
checkSetGFXPath();
BitmapTextureAtlas menuAtlas = new BitmapTextureAtlas(this.getTextureManager(), 200, 150, TextureOptions.BILINEAR);
TiledTextureRegion menuBG = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(menuAtlas, this, ResMan.MENU_BG, 0, 0, 1, 1);
TiledTextureRegion menuNext = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(menuAtlas, this, ResMan.MENU_NEXT, 0, 0, 1, 1);
TiledTextureRegion menuReset = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(menuAtlas, this, ResMan.MENU_RESET, 0, 50, 1, 1);
TiledTextureRegion menuQuit = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(menuAtlas, this, ResMan.MENU_QUIT, 0, 100, 1, 1);
putTexture(ResMan.MENU_BG, menuBG);
putTexture(ResMan.MENU_RESET, menuReset);
putTexture(ResMan.MENU_NEXT, menuNext);
putTexture(ResMan.MENU_QUIT, menuQuit);
menuAtlas.load();
}
示例6: loadSplashScene
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
protected void loadSplashScene() {
checkSetGFXPath();
BitmapTextureAtlas splashTextureAtlas = new BitmapTextureAtlas(textureManager, 2400, 1440, TextureOptions.BILINEAR);
TiledTextureRegion splashTextureRegion = BitmapTextureAtlasTextureRegionFactory.
createTiledFromAsset(splashTextureAtlas, this, ResMan.SPLASH_LAND, 0, 0, 1, 1);
splashTextureAtlas.load();
putTexture(ResMan.SPLASH_LAND, splashTextureRegion);
}
示例7: loadGFXAsset
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
private String loadGFXAsset(GFXAsset asset) {
BitmapTextureAtlas textureAtlas = new BitmapTextureAtlas(textureManager, asset.getWidth(), asset.getHeight(), TextureOptions.BILINEAR);
final String filename = asset.getFilename();
final int textureX = asset.getTextureX();
final int textureY = asset.getTextureY();
final int tileC = asset.getTileColumns();
final int tileR = asset.getTileRows();
TiledTextureRegion tiledTextureRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(textureAtlas, this, filename, textureX, textureY, tileC, tileR);
putTexture(filename, tiledTextureRegion);
textureAtlas.load();
return filename;
}
示例8: loadSettingsGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
private void loadSettingsGraphics() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
this.bitmapTextureAtlas_oke = new BitmapTextureAtlas(activity.getTextureManager(), oke_width, oke_height, TextureOptions.BILINEAR);
this.textureRegion_oke = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_oke, activity, "oke.png", 0, 0);
this.bitmapTextureAtlas_oke.load();
this.bitmapTextureAtlas_checkButton = new BitmapTextureAtlas(activity.getTextureManager(), check_button_width, check_button_height, TextureOptions.BILINEAR);
this.textureRegion_checkButton = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(this.bitmapTextureAtlas_checkButton, activity, "check.png", 0, 0, 2, 1);
this.bitmapTextureAtlas_checkButton.load();
this.bitmapTextureAtlas_panel = new BitmapTextureAtlas(activity.getTextureManager(), panel_width, panel_height, TextureOptions.BILINEAR);
this.textureRegion_panel = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_panel, activity, "panel.png", 0, 0);
this.bitmapTextureAtlas_panel.load();
}
示例9: onCreateResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
@Override
protected void onCreateResources() throws IOException {
mTexture = new AssetBitmapTexture(getTextureManager(), getAssets(), "player.png");
mTextureRegion = TextureRegionFactory.extractFromTexture(mTexture);
mTexture.load();
mBitmapTextureAtlas = new BitmapTextureAtlas(getTextureManager(), 100, 100, TextureOptions.BILINEAR);
mTiledTextureRegion = BitmapTextureAtlasTextureRegionFactory
.createTiledFromAsset(mBitmapTextureAtlas, getAssets(), "npc-oldman1.png", 0, 0, 4, 1);
mBitmapTextureAtlas.load();
}
示例10: AssetsManager
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的package包/类
public AssetsManager(Context pContext, Engine pEngine) {
this.mVertexBufferObjectManager = pEngine.getVertexBufferObjectManager();
this.mGameAtlas = new BitmapTextureAtlas(pEngine.getTextureManager(), 2048, 2048, TextureOptions.NEAREST_PREMULTIPLYALPHA);
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
this.mBackgroundTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mGameAtlas, pContext, "background.png", 0, 0);
this.mGroundTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(mGameAtlas, pContext, "ground.png", 0, 513);
this.mPipesTiledTextureRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(mGameAtlas, pContext, "pipes.png", 291, 0, 2, 1);
this.mFlappyTiledTextureRegion = BitmapTextureAtlasTextureRegionFactory.createTiledFromAsset(mGameAtlas,pContext,"flappy.png",401,0, 1, 3);
}
示例11: loadEndingResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入方法依赖的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();
}
}