本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory类的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureAtlasTextureRegionFactory类的具体用法?Java BitmapTextureAtlasTextureRegionFactory怎么用?Java BitmapTextureAtlasTextureRegionFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitmapTextureAtlasTextureRegionFactory类属于org.andengine.opengl.texture.atlas.bitmap包,在下文中一共展示了BitmapTextureAtlasTextureRegionFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadSprite
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.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();
}
示例4: onCreateResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.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();
}
}
}
示例7: loadHowToPlayResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.BitmapTextureAtlasTextureRegionFactory; //导入依赖的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.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);
}
}
示例11: onCreateResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的package包/类
public static void onCreateResources(SimpleBaseGameActivity activity){
// upper pipe
BitmapTextureAtlas upperPipeTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 130, 80, TextureOptions.DEFAULT);
mUpperPipeTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(upperPipeTextureAtlas, activity, "pipetop.png", 0, 0);
upperPipeTextureAtlas.load();
// upper pipe section
BitmapTextureAtlas upperPipeSectionTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 120, 80, TextureOptions.DEFAULT);
mUpperPipeSectionTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(upperPipeSectionTextureAtlas, activity, "pipesection.png", 0, 0);
upperPipeSectionTextureAtlas.load();
// lower pipe
BitmapTextureAtlas lowerPipeTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 130, 80, TextureOptions.DEFAULT);
mLowerPipeTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(lowerPipeTextureAtlas, activity, "pipetop.png", 0, 0);
lowerPipeTextureAtlas.load();
// lower pipe section
//BitmapTextureAtlas lowerPipeSectionTextureAtlas = new BitmapTextureAtlas(activity.getTextureManager(), 120, 120, TextureOptions.BILINEAR);
BitmapTextureAtlas lowerPipeSectionTextureAtlas =new BitmapTextureAtlas(activity.getTextureManager(), 120, 80, TextureOptions.DEFAULT);
mLowerPipeSectionTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(lowerPipeSectionTextureAtlas, activity, "pipesection.png", 0, 0);
lowerPipeSectionTextureAtlas.load();
BitmapTextureAtlas coinTextureAtlas =new BitmapTextureAtlas(activity.getTextureManager(), 30, 30, TextureOptions.DEFAULT);
coinTexture = BitmapTextureAtlasTextureRegionFactory.createFromAsset(coinTextureAtlas, activity, "coin.png", 0, 0);
coinTextureAtlas.load();
// BitmapTextureAtlas lowerPipeSectionTextureAtlas2 = new BitmapTextureAtlas(activity.getTextureManager(), 120, 1, TextureOptions.BILINEAR);
// mLowerPipeSectionTexture2 = BitmapTextureAtlasTextureRegionFactory.createFromAsset(lowerPipeSectionTextureAtlas2, activity, "pipesectionlower.png", 0, 0);
// lowerPipeSectionTextureAtlas2.load();
}
示例12: loadGame
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的package包/类
public void loadGame() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
final BitmapTextureAtlas backgroundTextureAtlas = new BitmapTextureAtlas(mContext.getTextureManager(), 712, 1024, TextureOptions.BILINEAR_PREMULTIPLYALPHA);
mBackgroundRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(backgroundTextureAtlas, mContext.getAssets(), "racetrack.png", 0, 0);
backgroundTextureAtlas.load();
final BitmapTextureAtlas raceCarTextureAtlas = new BitmapTextureAtlas(mContext.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
mRaceCarRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(raceCarTextureAtlas, mContext.getAssets(), "race_car.png", 0, 0);
raceCarTextureAtlas.load();
final BitmapTextureAtlas opponentsTextureAtlas = new BitmapTextureAtlas(mContext.getTextureManager(), 256, 256, TextureOptions.BILINEAR);
mOpponentsRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(opponentsTextureAtlas, mContext.getAssets(), "race_car.png", 0, 0);
mExplosionRegion = BitmapTextureAtlasTextureRegionFactory.createFromAsset(opponentsTextureAtlas, mContext.getAssets(), "explosion.png", 128, 128);
opponentsTextureAtlas.load();
final BitmapTextureAtlas pauseTextureAtlas = new BitmapTextureAtlas(mContext.getTextureManager(), 128, 128, TextureOptions.BILINEAR);
pauseTextureAtlas.load();
loadGameFonts();
loadMenuFonts();
try {
loadMusic();
} catch (IOException e) {
Log.e("MUSIC_EXCEPTION", e.getMessage());
}
}
示例13: createBackground
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory; //导入依赖的package包/类
private void createBackground(final Bitmap background, @Nullable final String backgroundUrl) {
if (background == null) return;
BitmapTextureAtlas bitmapTextureAtlas = new BitmapTextureAtlas(_engine.getTextureManager(), _width, _height, TextureOptions.BILINEAR);
IBitmapTextureAtlasSource baseTextureSource = new EmptyBitmapTextureAtlasSource(_width, _height);
final IBitmapTextureAtlasSource bitmapTextureAtlasSource = new BaseBitmapTextureAtlasSourceDecorator(baseTextureSource) {
@Override
protected void onDecorateBitmap(Canvas pCanvas) throws Exception {
if (backgroundUrl != null) {
Bitmap template = BitmapFactory.decodeStream(GoogleFlipGameApplication.sContext.getAssets().open(backgroundUrl));
pCanvas.drawBitmap(template, 0, 0, mPaint);
}
pCanvas.drawColor(_backgroundColor);
pCanvas.drawBitmap(background, 0, 0, mPaint);
}
@Override
public BaseBitmapTextureAtlasSourceDecorator deepCopy() {
throw new IModifier.DeepCopyNotSupportedException();
}
};
ITextureRegion mDecoratedBalloonTextureRegion = BitmapTextureAtlasTextureRegionFactory.createFromSource(bitmapTextureAtlas, bitmapTextureAtlasSource,
0, 0);
bitmapTextureAtlas.load();
Sprite sprite = new Sprite(0, 0, mDecoratedBalloonTextureRegion, _engine.getVertexBufferObjectManager());
sprite.setOffsetCenter(0, 0);
sprite.setWidth(_width);
sprite.setHeight(_height);
_background = new SpriteBackground(sprite);
_engine.getScene().setBackground(_background);
}
示例14: 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);
}
示例15: 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();
}