本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas.load方法的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureAtlas.load方法的具体用法?Java BitmapTextureAtlas.load怎么用?Java BitmapTextureAtlas.load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas
的用法示例。
在下文中一共展示了BitmapTextureAtlas.load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
}
示例3: 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);
}
示例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, 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();
}
示例5: loadGame
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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());
}
}
示例6: loadGameFonts
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的package包/类
public void loadGameFonts() {
mTypeface = Typeface.createFromAsset(mContext.getAssets(), "LCD.ttf");
final ITexture scoreTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 256, 512, TextureOptions.BILINEAR);
mGameFont = new Font(mContext.getFontManager(), scoreTexture, mTypeface, 18, true, new Color(Color.BLACK));
scoreTexture.load();
mGameFont.load();
final BitmapTextureAtlas gamePlayTexture = new BitmapTextureAtlas(mContext.getTextureManager(), 512, 512, TextureOptions.BILINEAR);
mGamePlayFont = new StrokeFont(mContext.getFontManager(), gamePlayTexture, mTypeface, 96, true, new Color(Color.WHITE), 0, new Color(Color.WHITE));
gamePlayTexture.load();
mGamePlayFont.load();
}
示例7: createBackground
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
示例8: loadSplashScene
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
示例9: loadMenus
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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();
}
示例10: loadSplashScene
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
示例11: loadGFXAsset
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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;
}
示例12: onCreateResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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();
}
示例13: loadMainMenuResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
}
}
示例14: loadOptionResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
}
}
示例15: loadControllerOptionResources
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas; //导入方法依赖的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);
}
}
}