本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas类的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureAtlas类的具体用法?Java BitmapTextureAtlas怎么用?Java BitmapTextureAtlas使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitmapTextureAtlas类属于org.andengine.opengl.texture.atlas.bitmap包,在下文中一共展示了BitmapTextureAtlas类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadSprite
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
private Sprite loadSprite(final float pCameraWidth, final float pCameraHeight, final TextureManager pTextureManager, final IBitmapTextureAtlasSource pBitmapTextureAtlasSource, final VertexBufferObjectManager pVertexBufferObjectManager) throws IllegalArgumentException {
this.mBitmapTextureAtlas = new BitmapTextureAtlas(pTextureManager, pBitmapTextureAtlasSource.getTextureWidth(), pBitmapTextureAtlasSource.getTextureHeight(), BitmapTextureFormat.RGBA_8888, TextureOptions.REPEATING_NEAREST);
final ITextureRegion textureRegion = BitmapTextureAtlasTextureRegionFactory.createFromSource(this.mBitmapTextureAtlas, pBitmapTextureAtlasSource, 0, 0);
final int width = Math.round(pCameraWidth / this.mScale);
final int height = Math.round(pCameraHeight / this.mScale);
textureRegion.setTextureWidth(width);
textureRegion.setTextureHeight(height);
this.mBitmapTextureAtlas.load();
final Sprite sprite = new Sprite(0, 0, width, height, textureRegion, pVertexBufferObjectManager);
sprite.setScaleCenter(0, 0);
sprite.setScale(this.mScale);
return sprite;
}
示例2: loadMenuGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
private void loadMenuGraphics() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
this.bitmapTextureAtlas_background = new BitmapTextureAtlas(activity.getTextureManager(), Constants.width, Constants.height, TextureOptions.NEAREST_PREMULTIPLYALPHA);
this.backgroundTiledTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_background, activity, "bg-tre.png", 0, 0);
this.bitmapTextureAtlas_background.load();
this.bitmapTextureAtlas_logo = new BitmapTextureAtlas(activity.getTextureManager(), logo_width, logo_height , TextureOptions.BILINEAR);
this.textureRegion_logo = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_logo, activity, "logo.png", 0, 0);
this.bitmapTextureAtlas_logo.load();
this.bitmapTextureAtlas_startButton = new BitmapTextureAtlas(activity.getTextureManager(), start_button_width, start_button_height, TextureOptions.BILINEAR);
this.textureRegion_startButton = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_startButton, activity, "start.png", 0, 0);
this.bitmapTextureAtlas_startButton.load();
this.bitmapTextureAtlas_shareButton = new BitmapTextureAtlas(activity.getTextureManager(), share_button_width, share_button_height, TextureOptions.BILINEAR);
this.textureRegion_shareButton = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_shareButton, activity, "share.png", 0, 0);
this.bitmapTextureAtlas_shareButton.load();
this.bitmapTextureAtlas_settingsButton = new BitmapTextureAtlas(activity.getTextureManager(), settings_button_width, settings_button_height, TextureOptions.BILINEAR);
this.textureRegion_settingsButton = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.bitmapTextureAtlas_settingsButton, activity, "setting.png", 0, 0);
this.bitmapTextureAtlas_settingsButton.load();
}
示例3: loadGameGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的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();
}
示例4: onCreateResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
public static void onCreateResources(SimpleBaseGameActivity activity){
// upper pipe
BitmapTextureAtlas upperPipeTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 130, 60, TextureOptions.BILINEAR);
mUpperPipeTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(upperPipeTextureAtlas, activity, "pipeupper.png", 0, 0);
upperPipeTextureAtlas.load();
// upper pipe section
BitmapTextureAtlas upperPipeSectionTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 120, 1, TextureOptions.BILINEAR);
mUpperPipeSectionTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(upperPipeSectionTextureAtlas, activity, "pipesectionupper.png", 0, 0);
upperPipeSectionTextureAtlas.load();
// lower pipe
BitmapTextureAtlas lowerPipeTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 130, 60, TextureOptions.BILINEAR);
mLowerPipeTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(lowerPipeTextureAtlas, activity, "pipelower.png", 0, 0);
lowerPipeTextureAtlas.load();
// lower pipe section
BitmapTextureAtlas lowerPipeSectionTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 120, 1, TextureOptions.BILINEAR);
mLowerPipeSectionTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(lowerPipeSectionTextureAtlas, activity, "pipesectionlower.png", 0, 0);
lowerPipeSectionTextureAtlas.load();
}
示例5: getTextureRegion
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
private ITextureRegion getTextureRegion(String fileName, BitmapTextureAtlas bta) throws IOException {
InputStream in = null;
try {
in = gameActivity.getResources().getAssets().open("gfx/" + fileName);
return BitmapTextureAtlasTextureRegionFactory.createFromAsset(
bta, gameActivity, fileName, 0, 0);
} catch (IOException e) {
IBitmapTextureAtlasSource ats = FileBitmapTextureAtlasSource.createFromInternalStorage(
gameActivity, "/gfx/" + fileName, 0, 0);
return BitmapTextureAtlasTextureRegionFactory.createFromSource(bta, ats, 0, 0);
} finally {
if (in != null) {
in.close();
}
}
}
示例6: getTiledTextureRegion
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的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();
}
}
}
示例7: loadHowToPlayResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
public synchronized void loadHowToPlayResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
if (howToPlayArrow == null) {
BitmapTextureAtlas howToPlayArrowT = new BitmapTextureAtlas(this.textureManager, 149, 203,
mTransparentTextureOption);
howToPlayArrow = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
howToPlayArrowT, this.activity, "how_to_play_arrow.png", 0, 0);
howToPlayArrowT.load();
}
if (howToPlayButton == null) {
BitmapTextureAtlas howToPlayButtonT = new BitmapTextureAtlas(this.textureManager, 182, 254,
mTransparentTextureOption);
howToPlayButton = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
howToPlayButtonT, this.activity, "how_to_play_button.png", 0, 0);
howToPlayButtonT.load();
}
if (howToPlayDigitalPad == null) {
BitmapTextureAtlas howToPlayDigitalPadT = new BitmapTextureAtlas(this.textureManager, 471, 334,
mTransparentTextureOption);
howToPlayDigitalPad = BitmapTextureAtlasTextureRegionFactory.createFromAsset(
howToPlayDigitalPadT, this.activity, "how_to_play_digital_pad.png", 0, 0);
howToPlayDigitalPadT.load();
}
}
示例8: loadRecordsResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
public synchronized void loadRecordsResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/results/");
BitmapTextureAtlas recordHeadsT = new BitmapTextureAtlas(this.textureManager, 100, 100,
mTransparentTextureOption);
BitmapTextureAtlasTextureRegionFactory.createFromAsset(
recordHeadsT, this.activity, "results_records_winner_faces.png", 0, 0);
recordHeadsT.load();
menuRecordsRyokoHead = TextureRegionFactory.
extractFromTexture(recordHeadsT, 0, 0, 50, 50, false);
menuRecordsRyokoHeadGold = TextureRegionFactory.
extractFromTexture(recordHeadsT, 0, 50, 50, 50, false);
menuRecordsShoHead = TextureRegionFactory.
extractFromTexture(recordHeadsT, 50, 0, 50, 50, false);
menuRecordsShoHeadGold = TextureRegionFactory.
extractFromTexture(recordHeadsT, 50, 50, 50, 50, false);
}
示例9: loadMenuGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的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);
}
}
示例10: loadGameGraphics
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的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);
}
}
示例11: dialogText
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
/**
* Font used for displaying text in a Button
* @return
*/
public static Font dialogText() {
if (dialogFont == null) {
BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
dialogFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 32, true, new Color(0.5f, 0.5f, 0.5f).getABGRPackedInt());
dialogFont.load();
}
return dialogFont;
}
示例12: itemCost
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
/**
* Font used for displaying the cost of an InventoryItem.
* @return
*/
public static Font itemCost() {
if (itemCostFont == null) {
BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
itemCostFont = FontFactory.createStroke(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 24, true, new Color(0.96f, 0.70f, 0f).getARGBPackedInt(), 0.5f, new Color(0.95f, 0.61f, 0f).getARGBPackedInt());
itemCostFont.load();
}
return itemCostFont;
}
示例13: inventoryCount
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
/**
* Font used for displaying the quantity of an InventoryItem.
* @return
*/
public static Font inventoryCount() {
if (inventoryCountFont == null) {
BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
inventoryCountFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 24, true, new Color(0.5f, 0.5f, 0.5f).getABGRPackedInt());
inventoryCountFont.load();
}
return inventoryCountFont;
}
示例14: defaultHUDDisplay
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
/**
* Font used for displaying the level and account balance in the DefaultHUD.
* @return
*/
public static Font defaultHUDDisplay() {
if (defaultHUDDisplayFont == null) {
BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
defaultHUDDisplayFont = FontFactory.create(PhoeniciaContext.fontManager, texture, Typeface.create(Typeface.MONOSPACE, Typeface.BOLD), 30, true, Color.WHITE_ARGB_PACKED_INT);
defaultHUDDisplayFont.load();
}
return defaultHUDDisplayFont;
}
示例15: introText
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入依赖的package包/类
public static Font introText() {
if (introTextFont == null) {
BitmapTextureAtlas texture = new BitmapTextureAtlas(PhoeniciaContext.textureManager, 1024, 1024, TextureOptions.BILINEAR);
introTextFont = FontFactory.create(PhoeniciaContext.fontManager, PhoeniciaContext.textureManager, 256, 256, TextureOptions.BILINEAR, Typeface.create(Typeface.DEFAULT, Typeface.BOLD), 36, Color.BLUE_ARGB_PACKED_INT);
introTextFont.load();
}
return introTextFont;
}