当前位置: 首页>>代码示例>>Java>>正文


Java BitmapTextureFormat类代码示例

本文整理汇总了Java中org.andengine.opengl.texture.bitmap.BitmapTextureFormat的典型用法代码示例。如果您正苦于以下问题:Java BitmapTextureFormat类的具体用法?Java BitmapTextureFormat怎么用?Java BitmapTextureFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BitmapTextureFormat类属于org.andengine.opengl.texture.bitmap包,在下文中一共展示了BitmapTextureFormat类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadSprite

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的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;
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:18,代码来源:RepeatingSpriteBackground.java

示例2: getTexture

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public synchronized ITexture getTexture(final String pID, final IInputStreamOpener pInputStreamOpener, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final boolean pLoadToHardware) throws IOException {
	if (this.hasMappedTexture(pID)) {
		return this.getMappedTexture(pID);
	} else {
		final ITexture texture = new BitmapTexture(this, pInputStreamOpener, pBitmapTextureFormat, pTextureOptions);
		if (pLoadToHardware) {
			this.loadTexture(texture);
		}
		this.addMappedTexture(pID, texture);

		return texture;
	}
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:14,代码来源:TextureManager.java

示例3: getTexture

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public synchronized ITexture getTexture(final String pID, final IInputStreamOpener pInputStreamOpener, final BitmapTextureFormat pBitmapTextureFormat, final TextureOptions pTextureOptions, final boolean pLoadToHardware) throws IOException {
	if(this.hasMappedTexture(pID)) {
		return this.getMappedTexture(pID);
	} else {
		final ITexture texture = new BitmapTexture(this, pInputStreamOpener, pBitmapTextureFormat, pTextureOptions);
		if(pLoadToHardware) {
			this.loadTexture(texture);
		}
		this.addMappedTexture(pID, texture);

		return texture;
	}
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:14,代码来源:TextureManager.java

示例4: setImageSourceFromAttributes

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的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

示例5: BitmapFont

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public BitmapFont(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath) {
	this(pTextureManager, pAssetManager, pAssetPath, BitmapTextureFormat.RGBA_8888, TextureOptions.DEFAULT, BitmapFontOptions.DEFAULT);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:BitmapFont.java

示例6: getTexture

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public synchronized ITexture getTexture(final String pID, final IInputStreamOpener pInputStreamOpener, final TextureOptions pTextureOptions) throws IOException {
	return this.getTexture(pID, pInputStreamOpener, BitmapTextureFormat.RGBA_8888, pTextureOptions);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:TextureManager.java

示例7: BitmapTextureAtlas

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
/**
 * Uses {@link BitmapTextureFormat#RGBA_8888}.
 */
public BitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight) {
	this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:7,代码来源:BitmapTextureAtlas.java

示例8: getBitmapTextureFormat

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public BitmapTextureFormat getBitmapTextureFormat() {
	return this.mBitmapTextureFormat;
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:4,代码来源:BitmapTextureAtlas.java

示例9: BuildableBitmapTextureAtlas

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
/**
 * Uses {@link BitmapTextureFormat#RGBA_8888}.
 */
public BuildableBitmapTextureAtlas(final TextureManager pTextureManager, final int pWidth, final int pHeight) {
	this(pTextureManager, pWidth, pHeight, BitmapTextureFormat.RGBA_8888);
}
 
开发者ID:ArturVasilov,项目名称:AndroidCourses,代码行数:7,代码来源:BuildableBitmapTextureAtlas.java

示例10: create

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public static Font create(final FontManager pFontManager, final TextureManager pTextureManager, final int pTextureWidth, final int pTextureHeight, final TextureOptions pTextureOptions, final Typeface pTypeface, final float pSize, final boolean pAntiAlias, final int pColor) {
	return FontFactory.create(pFontManager, pTextureManager, pTextureWidth, pTextureHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, pTypeface, pSize, pAntiAlias, pColor);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:4,代码来源:FontFactory.java

示例11: createFromAsset

import org.andengine.opengl.texture.bitmap.BitmapTextureFormat; //导入依赖的package包/类
public static Font createFromAsset(final FontManager pFontManager, final TextureManager pTextureManager, final int pTextureWidth, final int pTextureHeight, final TextureOptions pTextureOptions, final AssetManager pAssetManager, final String pAssetPath, final float pSize, final boolean pAntiAlias, final int pColor) {
	return FontFactory.createFromAsset(pFontManager, pTextureManager, pTextureWidth, pTextureHeight, BitmapTextureFormat.RGBA_8888, pTextureOptions, pAssetManager, pAssetPath, pSize, pAntiAlias, pColor);
}
 
开发者ID:peterchaula,项目名称:ClassicF1,代码行数:4,代码来源:FontFactory.java


注:本文中的org.andengine.opengl.texture.bitmap.BitmapTextureFormat类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。