本文整理汇总了Java中org.andengine.opengl.texture.bitmap.BitmapTextureFormat.RGBA_8888属性的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureFormat.RGBA_8888属性的具体用法?Java BitmapTextureFormat.RGBA_8888怎么用?Java BitmapTextureFormat.RGBA_8888使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.andengine.opengl.texture.bitmap.BitmapTextureFormat
的用法示例。
在下文中一共展示了BitmapTextureFormat.RGBA_8888属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setImageSourceFromAttributes
/**
*
* @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();
}
}
示例2: BitmapFont
public BitmapFont(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath) {
this(pTextureManager, pAssetManager, pAssetPath, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, BitmapFontOptions.DEFAULT);
}
示例3: BitmapFont
public BitmapFont(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath, final TextureOptions pTextureOptions) {
this(pTextureManager, pAssetManager, pAssetPath, BitmapTextureFormat.RGBA_8888, pTextureOptions, BitmapFontOptions.DEFAULT);
}
示例4: BitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*/
public BitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight) {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888);
}
示例5: BuildableBitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*/
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight) {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888);
}
示例6: BitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*
* @param pTextureOptions the (quality) settings of this {@link BitmapTextureAtlas}.
*/
public BitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight, final TextureOptions pTextureOptions) throws IllegalArgumentException {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, null);
}
示例7: BuildableBitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*
* @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load.
*/
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, pTextureStateListener);
}
示例8: BuildableBitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*
* @param pTextureOptions the (quality) settings of the BitmapTexture.
* @param pTextureStateListener to be informed when this {@link BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load.
*/
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight, final TextureOptions pTextureOptions, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) throws IllegalArgumentException {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, pTextureStateListener);
}
示例9: BuildableBitmapTextureAtlas
/**
* Uses {@link BitmapTextureFormat#RGBA_8888}.
*
* @param pTextureStateListener to be informed when this {@link org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas} is loaded, unloaded or a {@link ITextureAtlasSource} failed to load.
*/
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight, final ITextureAtlasStateListener<IBitmapTextureAtlasSource> pTextureStateListener) {
this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, pTextureStateListener);
}