本文整理汇总了Java中org.andengine.util.adt.io.in.AssetInputStreamOpener类的典型用法代码示例。如果您正苦于以下问题:Java AssetInputStreamOpener类的具体用法?Java AssetInputStreamOpener怎么用?Java AssetInputStreamOpener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssetInputStreamOpener类属于org.andengine.util.adt.io.in包,在下文中一共展示了AssetInputStreamOpener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BitmapFontPage
import org.andengine.util.adt.io.in.AssetInputStreamOpener; //导入依赖的package包/类
public BitmapFontPage(final AssetManager pAssetManager, final String pAssetBasePath, final String pData) throws IOException {
final String[] pageAttributes = TextUtils.SPLITPATTERN_SPACE.split(pData, BitmapFont.TAG_PAGE_ATTRIBUTECOUNT + 1);
if ((pageAttributes.length - 1) != BitmapFont.TAG_PAGE_ATTRIBUTECOUNT) {
throw new FontException("Expected: '" + BitmapFont.TAG_PAGE_ATTRIBUTECOUNT + "' " + BitmapFont.TAG_PAGE + " attributes, found: '" + (pageAttributes.length - 1) + "'.");
}
if (!pageAttributes[0].equals(BitmapFont.TAG_PAGE)) {
throw new FontException("Expected: '" + BitmapFont.TAG_PAGE + "' attributes.");
}
this.mID = BitmapFont.getIntAttribute(pageAttributes, BitmapFont.TAG_PAGE_ATTRIBUTE_ID_INDEX, BitmapFont.TAG_PAGE_ATTRIBUTE_ID);
final String file = BitmapFont.getStringAttribute(pageAttributes, BitmapFont.TAG_PAGE_ATTRIBUTE_FILE_INDEX, BitmapFont.TAG_PAGE_ATTRIBUTE_FILE);
final String assetPath = pAssetBasePath + file;
this.mTexture = new BitmapTexture(BitmapFont.this.mTextureManager, new AssetInputStreamOpener(pAssetManager, assetPath), BitmapFont.this.mBitmapTextureFormat, BitmapFont.this.mTextureOptions);
}
示例2: BitmapFontPage
import org.andengine.util.adt.io.in.AssetInputStreamOpener; //导入依赖的package包/类
public BitmapFontPage(final AssetManager pAssetManager, final String pAssetBasePath, final String pData) throws IOException {
final String[] pageAttributes = TextUtils.SPLITPATTERN_SPACE.split(pData, BitmapFont.TAG_PAGE_ATTRIBUTECOUNT + 1);
if((pageAttributes.length - 1) != BitmapFont.TAG_PAGE_ATTRIBUTECOUNT) {
throw new FontException("Expected: '" + BitmapFont.TAG_PAGE_ATTRIBUTECOUNT + "' " + BitmapFont.TAG_PAGE + " attributes, found: '" + (pageAttributes.length - 1) + "'.");
}
if(!pageAttributes[0].equals(BitmapFont.TAG_PAGE)) {
throw new FontException("Expected: '" + BitmapFont.TAG_PAGE + "' attributes.");
}
this.mID = BitmapFont.getIntAttribute(pageAttributes, BitmapFont.TAG_PAGE_ATTRIBUTE_ID_INDEX, BitmapFont.TAG_PAGE_ATTRIBUTE_ID);
final String file = BitmapFont.getStringAttribute(pageAttributes, BitmapFont.TAG_PAGE_ATTRIBUTE_FILE_INDEX, BitmapFont.TAG_PAGE_ATTRIBUTE_FILE);
final String assetPath = pAssetBasePath + file;
this.mTexture = new BitmapTexture(BitmapFont.this.mTextureManager, new AssetInputStreamOpener(pAssetManager, assetPath), BitmapFont.this.mBitmapTextureFormat, BitmapFont.this.mTextureOptions);
}
示例3: getTexture
import org.andengine.util.adt.io.in.AssetInputStreamOpener; //导入依赖的package包/类
public synchronized ITexture getTexture(final String pID, final AssetManager pAssetManager, final String pAssetPath, final TextureOptions pTextureOptions) throws IOException {
if(this.hasMappedTexture(pID)) {
return this.getMappedTexture(pID);
} else {
final ITexture texture = new BitmapTexture(this, new AssetInputStreamOpener(pAssetManager, pAssetPath), pTextureOptions);
this.loadTexture(texture);
this.addMappedTexture(pID, texture);
return texture;
}
}
示例4: AssetBitmapTexture
import org.andengine.util.adt.io.in.AssetInputStreamOpener; //导入依赖的package包/类
public AssetBitmapTexture(final TextureManager pTextureManager, final AssetManager pAssetManager, final String pAssetPath) throws IOException {
super(pTextureManager, new AssetInputStreamOpener(pAssetManager, pAssetPath));
}