/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (Texture texture, int width, int height) { this.texture = texture; setRegion(0, 0, width, height); }
/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (Texture texture, int x, int y, int width, int height) { this.texture = texture; setRegion(x, y, width, height); }
/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (Texture texture, int width, int height) { this.texture = texture; setRegion(0, 0, width, height); }
public TextureRegion (Texture texture, float u, float v, float u2, float v2) { this.texture = texture; setRegion(u, v, u2, v2); }
/** Constructs a region with the same texture and coordinates of the specified region. */ public TextureRegion (TextureRegion region) { setRegion(region); }
public void setRegion (float u, float v, float u2, float v2) { super.setRegion(u, v, u2, v2); float[] vertices = Sprite.this.vertices; vertices[U1] = u; vertices[V1] = v2; vertices[U2] = u; vertices[V2] = v; vertices[U3] = u2; vertices[V3] = v; vertices[U4] = u2; vertices[V4] = v2; }
/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (Texture texture, int x, int y, int width, int height) { this.texture = texture; setRegion(x, y, width, height); }
/** Sets the texture and coordinates to the specified region. */ public void setRegion (TextureRegion region) { texture = region.texture; setRegion(region.u, region.v, region.u2, region.v2); }
/** Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region. * @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (TextureRegion region, int x, int y, int width, int height) { setRegion(region, x, y, width, height); }
/** Sets the texture and coordinates to the specified region. */ public void setRegion (TextureRegion region) { texture = region.texture; setRegion(region.u, region.v, region.u2, region.v2); }
public void setRegion (float u, float v, float u2, float v2) { super.setRegion(u, v, u2, v2); float[] vertices = Sprite.this.vertices; vertices[U1] = u; vertices[V1] = v2; vertices[U2] = u; vertices[V2] = v; vertices[U3] = u2; vertices[V3] = v; vertices[U4] = u2; vertices[V4] = v2; }
/** Constructs a region with the same texture as the specified region and sets the coordinates relative to the specified region. * @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public TextureRegion (TextureRegion region, int x, int y, int width, int height) { setRegion(region, x, y, width, height); }
/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public void setRegion (int x, int y, int width, int height) { float invTexWidth = 1f / texture.getWidth(); float invTexHeight = 1f / texture.getHeight(); setRegion(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight); regionWidth = Math.abs(width); regionHeight = Math.abs(height); }
/** @param width The width of the texture region. May be negative to flip the sprite when drawn. * @param height The height of the texture region. May be negative to flip the sprite when drawn. */ public void setRegion (int x, int y, int width, int height) { float invTexWidth = 1f / texture.getWidth(); float invTexHeight = 1f / texture.getHeight(); setRegion(x * invTexWidth, y * invTexHeight, (x + width) * invTexWidth, (y + height) * invTexHeight); regionWidth = Math.abs(width); regionHeight = Math.abs(height); }
/** Constructs a region the size of the specified texture. */ public TextureRegion (Texture texture) { if (texture == null) throw new IllegalArgumentException("texture cannot be null."); this.texture = texture; setRegion(0, 0, texture.getWidth(), texture.getHeight()); }
/** Constructs a region the size of the specified texture. */ public TextureRegion (Texture texture) { if (texture == null) throw new IllegalArgumentException("texture cannot be null."); this.texture = texture; setRegion(0, 0, texture.getWidth(), texture.getHeight()); }
/** Sets the texture and sets the coordinates to the size of the specified texture. */ public void setRegion (Texture texture) { this.texture = texture; setRegion(0, 0, texture.getWidth(), texture.getHeight()); }
/** Sets the texture and sets the coordinates to the size of the specified texture. */ public void setRegion (Texture texture) { this.texture = texture; setRegion(0, 0, texture.getWidth(), texture.getHeight()); }
/** Sets the texture to that of the specified region and sets the coordinates relative to the specified region. */ public void setRegion (TextureRegion region, int x, int y, int width, int height) { texture = region.texture; setRegion(region.getRegionX() + x, region.getRegionY() + y, width, height); }
/** Sets the texture to that of the specified region and sets the coordinates relative to the specified region. */ public void setRegion (TextureRegion region, int x, int y, int width, int height) { texture = region.texture; setRegion(region.getRegionX() + x, region.getRegionY() + y, width, height); }