@Override public boolean equals (Object o) { if (o == null) return false; DecalMaterial material = (DecalMaterial)o; return dstBlendFactor == material.dstBlendFactor && srcBlendFactor == material.srcBlendFactor && textureRegion.getTexture() == material.textureRegion.getTexture(); }
@Override public int hashCode () { int result = textureRegion.getTexture() != null ? textureRegion.getTexture().hashCode() : 0; result = 31 * result + srcBlendFactor; result = 31 * result + dstBlendFactor; return result; } }
@Override public int hashCode () { int result = textureRegion.getTexture() != null ? textureRegion.getTexture().hashCode() : 0; result = 31 * result + srcBlendFactor; result = 31 * result + dstBlendFactor; return result; } }
/** Disposes the texture used by this BitmapFont's region IF this BitmapFont created the texture. */ public void dispose () { if (ownsTexture) { for (int i = 0; i < regions.size; i++) regions.get(i).getTexture().dispose(); } }
protected Array<TextureRegion> getRegions (Texture texture, Array<AtlasRegion> atlasRegions, Array<TextureRegion> out) { out.clear(); for(TextureRegion region : atlasRegions){ if(region.getTexture() == texture) out.add(region); } return out; }
@Override public void dispose () { ui.dispose(); skin.dispose(); image2.getTexture().dispose(); }
@Override public void dispose () { batch.dispose(); buttons.getTexture().dispose(); music.dispose(); } }
public void draw (Batch spriteBatch) { Array<TextureRegion> regions = font.getRegions(); for (int j = 0, n = pageVertices.length; j < n; j++) { if (idx[j] > 0) { // ignore if this texture has no glyphs float[] vertices = pageVertices[j]; spriteBatch.draw(regions.get(j).getTexture(), vertices, 0, idx[j]); } } }
public void draw (Batch spriteBatch) { Array<TextureRegion> regions = font.getRegions(); for (int j = 0, n = pageVertices.length; j < n; j++) { if (idx[j] > 0) { // ignore if this texture has no glyphs float[] vertices = pageVertices[j]; spriteBatch.draw(regions.get(j).getTexture(), vertices, 0, idx[j]); } } }
@Override public void dispose () { layers[0].getTexture().dispose(); batch.dispose(); font.dispose(); }
/** Binds the material's texture to the OpenGL context and changes the glBlendFunc to the values used by it. */ public void set () { textureRegion.getTexture().bind(0); if (!isOpaque()) { Gdx.gl.glBlendFunc(srcBlendFactor, dstBlendFactor); } }
protected void load (BitmapFontData data) { super.load(data); // Distance field font rendering requires font texture to be filtered linear. final Array<TextureRegion> regions = getRegions(); for (TextureRegion region : regions) region.getTexture().setFilter(TextureFilter.Linear, TextureFilter.Linear); }
/** Binds the material's texture to the OpenGL context and changes the glBlendFunc to the values used by it. */ public void set () { textureRegion.getTexture().bind(0); if (!isOpaque()) { Gdx.gl.glBlendFunc(srcBlendFactor, dstBlendFactor); } }
public void set (final TextureRegion region) { textureDescription.texture = region.getTexture(); offsetU = region.getU(); offsetV = region.getV(); scaleU = region.getU2() - offsetU; scaleV = region.getV2() - offsetV; }
public void set (final TextureRegion region) { textureDescription.texture = region.getTexture(); offsetU = region.getU(); offsetV = region.getV(); scaleU = region.getU2() - offsetU; scaleV = region.getV2() - offsetV; }
@Override public void onRegionsSelected (Array<TextureRegion> regions) { regionSelectDialog.setVisible(false); if(regions.size == 0) return; value.clear(); value.add((TextureRegion[])regions.toArray(TextureRegion.class)); editor.setTexture(regions.get(0).getTexture()); editor.restart(); }
@Override public void onRegionsSelected (Array<TextureRegion> regions) { regionSelectDialog.setVisible(false); if(regions.size == 0) return; value.clear(); value.add((TextureRegion[])regions.toArray(TextureRegion.class)); editor.setTexture(regions.get(0).getTexture()); editor.restart(); }
@Override public void dispose () { world.dispose(); renderer.dispose(); debugRenderer.dispose(); font.dispose(); textureRegion.getTexture().dispose(); } }
public void draw(PolygonSpriteBatch batch) { if(dirty) { buildVertices(); } for(int i = 0; i < vertices.size; i++) { batch.draw(region.getTexture(), vertices.get(i), 0, vertices.get(i).length, indices.get(i), 0, indices.get(i).length); } }
public void draw(PolygonSpriteBatch batch) { if(dirty) { buildVertices(); } for(int i = 0; i < vertices.size; i++) { batch.draw(region.getTexture(), vertices.get(i), 0, vertices.get(i).length, indices.get(i), 0, indices.get(i).length); } }