public static Image getDefaultTextureImage() { return _defaultTexture != null ? _defaultTexture.getImage() : null; }
public static Image getDefaultTextureImage() { return _defaultTexture != null ? _defaultTexture.getImage() : null; }
/** * @return the uv coordinate, in [0, 1], of the top edge of this SubTex as relates to its master Texture. */ public float getEndY() { return (_height + _y) / (float) _texture.getImage().getHeight(); }
/** * @return the uv coordinate, in [0, 1], of the left edge of this SubTex as relates to its master Texture. */ public float getStartX() { return _x / (float) _texture.getImage().getWidth(); }
/** * @return the uv coordinate, in [0, 1], of the top edge of this SubTex as relates to its master Texture. */ public float getEndY() { return (_height + _y) / (float) _texture.getImage().getHeight(); }
/** * @return the uv coordinate, in [0, 1], of the right edge of this SubTex as relates to its master Texture. */ public float getEndX() { return (_width + _x) / (float) _texture.getImage().getWidth(); }
/** * Construct a new SubTex that covers the entire width and height of the supplied Texture. * * @param texture * the base texture. Must already have a supplied image with a valid width and height. */ public SubTex(final Texture texture) { this(texture, 0, 0, texture.getImage().getWidth(), texture.getImage().getHeight()); }
/** * @return the uv coordinate, in [0, 1], of the right edge of this SubTex as relates to its master Texture. */ public float getEndX() { return (_width + _x) / (float) _texture.getImage().getWidth(); }
/** * @return the uv coordinate, in [0, 1], of the bottom edge of this SubTex as relates to its master Texture. */ public float getStartY() { return _y / (float) _texture.getImage().getHeight(); } }
/** * Construct a new SubTex that covers the entire width and height of the supplied Texture. * * @param texture * the base texture. Must already have a supplied image with a valid width and height. */ public SubTex(final Texture texture) { this(texture, 0, 0, texture.getImage().getWidth(), texture.getImage().getHeight()); }
/** * @return the uv coordinate, in [0, 1], of the left edge of this SubTex as relates to its master Texture. */ public float getStartX() { return _x / (float) _texture.getImage().getWidth(); }
/** * @return the uv coordinate, in [0, 1], of the bottom edge of this SubTex as relates to its master Texture. */ public float getStartY() { return _y / (float) _texture.getImage().getHeight(); } }
public int getHeight() { return texture.getImage().getHeight(); }
public int getWidth() { return texture.getImage().getWidth(); }
@Override public boolean equals(final Object other) { if (other == this) { return true; } if (!(other instanceof Texture)) { return false; } final Texture that = (Texture) other; if (getImage() != null && !getImage().equals(that.getImage())) { return false; } if (getImage() == null && that.getImage() != null) { return false; } if (getAnisotropicFilterPercent() != that.getAnisotropicFilterPercent()) { return false; } if (getMagnificationFilter() != that.getMagnificationFilter()) { return false; } if (getMinificationFilter() != that.getMinificationFilter()) { return false; } if (!_borderColor.equals(that._borderColor)) { return false; } return true; }
/** * Add a given texture to the cache * * @param texture * our texture */ public static void addToCache(final Texture texture) { if (TextureState.getDefaultTexture() == null || (texture != TextureState.getDefaultTexture() && texture.getImage() != TextureState.getDefaultTextureImage())) { _tCache.put(texture.getTextureKey(), texture); } }
/** * Add a given texture to the cache * * @param texture * our texture */ public static void addToCache(final Texture texture) { if (TextureState.getDefaultTexture() == null || (texture != TextureState.getDefaultTexture() && texture.getImage() != TextureState .getDefaultTextureImage())) { _tCache.put(texture.getTextureKey(), texture); } }
_styleName = capsule.readString("styleName", null); _pageTexture = (Texture) capsule.readSavable("pageTexture", null); _pageTexture = TextureManager.loadFromImage(_pageTexture.getImage(), _pageTexture.getMinificationFilter());
_styleName = capsule.readString("styleName", null); _pageTexture = (Texture) capsule.readSavable("pageTexture", null); _pageTexture = TextureManager.loadFromImage(_pageTexture.getImage(), _pageTexture.getMinificationFilter());