/** * 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; }