org.andengine.opengl.texture.bitmap.BitmapTexture Java Examples
The following examples show how to use
org.andengine.opengl.texture.bitmap.BitmapTexture.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BitmapFont.java From tilt-game-android with MIT License | 6 votes |
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); }
Example #2
Source File: BitmapFont.java From 30-android-libraries-in-30-days with Apache License 2.0 | 6 votes |
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); }
Example #3
Source File: ResourceLoader.java From sopa with Apache License 2.0 | 6 votes |
TextureRegion getTexture(final String path) { try { ITexture texture = new BitmapTexture(textureManager, new IInputStreamOpener() { @Override public InputStream open() throws IOException { return assetManager.open(path); } }, TextureOptions.BILINEAR); return TextureRegionFactory.extractFromTexture(texture); } catch (IOException e) { e.printStackTrace(); } return null; }
Example #4
Source File: TextureManager.java From tilt-game-android with MIT License | 5 votes |
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; } }
Example #5
Source File: TextureManager.java From 30-android-libraries-in-30-days with Apache License 2.0 | 5 votes |
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; } }
Example #6
Source File: TextureManager.java From 30-android-libraries-in-30-days with Apache License 2.0 | 5 votes |
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; } }