本文整理汇总了Java中org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource类的典型用法代码示例。如果您正苦于以下问题:Java AssetBitmapTextureAtlasSource类的具体用法?Java AssetBitmapTextureAtlasSource怎么用?Java AssetBitmapTextureAtlasSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssetBitmapTextureAtlasSource类属于org.andengine.opengl.texture.atlas.bitmap.source包,在下文中一共展示了AssetBitmapTextureAtlasSource类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: loadLocaleDefaults
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
private void loadLocaleDefaults() throws IOException {
try {
inventoryTexture = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, this.locale.inventoryBlock.block_texture);
inventoryTexture.load();
int[] inventoryTileSize = GameTextures.calculateTileSize(locale.inventoryBlock.columns, locale.inventoryBlock.rows, locale.inventoryBlock.height);
inventoryTiles = TextureRegionFactory.extractTiledFromTexture(inventoryTexture, 0, 0, inventoryTileSize[0] * 4, inventoryTileSize[1] * 2, 4, 2);
this.spriteMasks.put(inventoryTiles, AssetBitmapTextureAtlasSource.create(PhoeniciaContext.assetManager, this.locale.inventoryBlock.block_texture).onLoadBitmap(Bitmap.Config.ALPHA_8));
marketTexture = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, this.locale.marketBlock.block_texture);
marketTexture.load();
int[] marketTileSize = GameTextures.calculateTileSize(locale.marketBlock.columns, locale.marketBlock.rows, locale.marketBlock.height);
marketTiles = TextureRegionFactory.extractTiledFromTexture(marketTexture, 0, 0, marketTileSize[0] * 4, marketTileSize[1] * 2, 4, 2);
this.spriteMasks.put(marketTiles, AssetBitmapTextureAtlasSource.create(PhoeniciaContext.assetManager, this.locale.marketBlock.block_texture).onLoadBitmap(Bitmap.Config.ALPHA_8));
workshopTexture = new AssetBitmapTexture(PhoeniciaContext.textureManager, PhoeniciaContext.assetManager, this.locale.workshopBlock.block_texture);
workshopTexture.load();
int[] workshopTileSize = GameTextures.calculateTileSize(locale.workshopBlock.columns, locale.workshopBlock.rows, locale.workshopBlock.height);
workshopTiles = TextureRegionFactory.extractTiledFromTexture(workshopTexture, 0, 0, workshopTileSize[0] * 4, workshopTileSize[1] * 2, 4, 2);
this.spriteMasks.put(workshopTiles, AssetBitmapTextureAtlasSource.create(PhoeniciaContext.assetManager, this.locale.workshopBlock.block_texture).onLoadBitmap(Bitmap.Config.ALPHA_8));
} catch (final IOException e) {
e.printStackTrace();
throw e;
}
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:28,代码来源:PhoeniciaGame.java
示例2: setImageSourceFromAttributes
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
/**
*
* @param pAssetManager
* @param pTextureManager
* @param pAttributes
* @throws TMXParseException
*/
private void setImageSourceFromAttributes(final AssetManager pAssetManager, final TextureManager pTextureManager,
final Attributes pAttributes) throws TMXParseException {
final AssetBitmapTextureAtlasSource assetBitmapTextureAtlasSource = AssetBitmapTextureAtlasSource.create(
pAssetManager, this.mImageSource);
this.mTilesHorizontal = TMXTileSet.determineCount(assetBitmapTextureAtlasSource.getTextureWidth(),
this.mTileWidth, this.mMargin, this.mSpacing);
this.mTilesVertical = TMXTileSet.determineCount(assetBitmapTextureAtlasSource.getTextureHeight(),
this.mTileHeight, this.mMargin, this.mSpacing);
final BitmapTextureAtlas bitmapTextureAtlas = new BitmapTextureAtlas(pTextureManager,
assetBitmapTextureAtlasSource.getTextureWidth(), assetBitmapTextureAtlasSource.getTextureHeight(),
BitmapTextureFormat.RGBA_8888, this.mTextureOptions); // TODO
// Make
// TextureFormat
// variable
final String transparentColor = SAXUtils
.getAttribute(pAttributes, TMXConstants.TAG_IMAGE_ATTRIBUTE_TRANS, null);
if (transparentColor == null) {
BitmapTextureAtlasTextureRegionFactory.createFromSource(bitmapTextureAtlas, assetBitmapTextureAtlasSource,
0, 0);
} else {
try {
final int color = Color.parseColor((transparentColor.charAt(0) == '#') ? transparentColor : "#"
+ transparentColor);
BitmapTextureAtlasTextureRegionFactory.createFromSource(bitmapTextureAtlas,
new ColorKeyBitmapTextureAtlasSourceDecorator(assetBitmapTextureAtlasSource,
RectangleBitmapTextureAtlasSourceDecoratorShape.getDefaultInstance(), color), 0, 0);
} catch (final IllegalArgumentException e) {
throw new TMXParseException(
"Illegal value: '" + transparentColor + "' for attribute 'trans' supplied!", e);
}
}
/*
* Check we're using a manager, if so load in the texture and then map the text to source.
*/
if (this.mTMXTileSetSourceManager != null) {
this.mTexture = bitmapTextureAtlas;
this.mTexture.load();
this.mTMXTileSetSourceManager.addTileSetTexture(this.mImageSource, bitmapTextureAtlas);
this.mTMXTileSetSourceManager.addTileSourcesSize(this.mImageSource, new int[] { this.mTilesHorizontal,
this.mTilesHorizontal });
} else {
// No manager so load
this.mTexture = bitmapTextureAtlas;
this.mTexture.load();
}
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:55,代码来源:TMXTileSet.java
示例3: TileSetSourceObject
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
public TileSetSourceObject(String pTileSetImageSource, AssetBitmapTextureAtlasSource pAssetBitmapTextureAtlasSource, int pTilesHorizontal, int pTilesVertical){
this.mTileSetImageSource = pTileSetImageSource;
this.mAssetBitmapTextureAtlasSource = pAssetBitmapTextureAtlasSource;
this.mTilesHorizontal = pTilesHorizontal;
this.mTilesVertical = pTilesVertical;
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:7,代码来源:TileSetSourceObject.java
示例4: getBitmapAssest
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
public AssetBitmapTextureAtlasSource getBitmapAssest(){
return this.mAssetBitmapTextureAtlasSource;
}
开发者ID:Linguaculturalists,项目名称:Phoenicia,代码行数:4,代码来源:TileSetSourceObject.java
示例5: createFromAsset
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
public static TextureRegion createFromAsset(final BitmapTextureAtlas pBitmapTextureAtlas, final AssetManager pAssetManager, final String pAssetPath, final int pTextureX, final int pTextureY) {
final IBitmapTextureAtlasSource bitmapTextureAtlasSource = AssetBitmapTextureAtlasSource.create(pAssetManager, BitmapTextureAtlasTextureRegionFactory.sAssetBasePath + pAssetPath);
return BitmapTextureAtlasTextureRegionFactory.createFromSource(pBitmapTextureAtlas, bitmapTextureAtlasSource, pTextureX, pTextureY);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:5,代码来源:BitmapTextureAtlasTextureRegionFactory.java
示例6: createTiledFromAsset
import org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource; //导入依赖的package包/类
public static TiledTextureRegion createTiledFromAsset(final BitmapTextureAtlas pBitmapTextureAtlas, final AssetManager pAssetManager, final String pAssetPath, final int pTextureX, final int pTextureY, final int pTileColumns, final int pTileRows) {
final IBitmapTextureAtlasSource bitmapTextureAtlasSource = AssetBitmapTextureAtlasSource.create(pAssetManager, BitmapTextureAtlasTextureRegionFactory.sAssetBasePath + pAssetPath);
return BitmapTextureAtlasTextureRegionFactory.createTiledFromSource(pBitmapTextureAtlas, bitmapTextureAtlasSource, pTextureX, pTextureY, pTileColumns, pTileRows);
}
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:5,代码来源:BitmapTextureAtlasTextureRegionFactory.java
注:本文中的org.andengine.opengl.texture.atlas.bitmap.source.AssetBitmapTextureAtlasSource类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论