/** Sets {@link #region}. * @return {@code this}, for convenient call chaining. */ public ImageLayer setRegion (Rectangle region) { this.region = region; checkOrigin(); return this; }
/** Sets {@link #forceWidth} and {@link #forceHeight}. * @return {@code this}, for convenient call chaining. */ public ImageLayer setSize (float width, float height) { forceWidth = width; forceHeight = height; checkOrigin(); return this; }
/** * Sets the texture rendered by this layer. One can supplied {@code null} to release and clear * any texture currently being rendered and leave this layer in an uninitialized state. This * isn't something one would normally do, but could be useful if one was free-listing image * layers for some reason. */ public ImageLayer setTile (Tile tile) { // avoid releasing and rereferencing texture if nothing changes if (this.tile != tile) { if (this.tile != null) this.tile.texture().release(); this.tile = tile; checkOrigin(); if (tile != null) tile.texture().reference(); } return this; }