ThreadSafeLayer

open class ThreadSafeLayer(initialPosition: Position, initialContents: TileGraphics, movable: Movable, backend: InternalTileGraphics) : Clearable, InternalLayer, Movable, TileGraphics

Functions

applyStyle
Link copied to clipboard
common
override fun applyStyle(styleSet: StyleSet)
Applies the given styleSet to all currently present Tiles in this TileGraphics.
asInternalLayer
Link copied to clipboard
common
open override fun asInternalLayer(): ThreadSafeLayer
Returns this Layer as an InternalLayer that represents Zircon's internal API.
clear
Link copied to clipboard
common
override fun clear()
Clears this Clearable.
containsBoundable
Link copied to clipboard
common
open infix override fun containsBoundable(boundable: Boundable): Boolean
containsPosition
Link copied to clipboard
common
open infix override fun containsPosition(position: Position): Boolean
createCopy
Link copied to clipboard
common
override fun createCopy(): Layer
Creates a deep copy of this object.
draw
Link copied to clipboard
common
override fun draw(tileMap: Map<Position, Tile>)
Same as draw with 3 parameters, with the difference that size will be used for drawArea, and Position.zero as drawPosition
override fun draw(tileComposite: TileComposite)
Same as draw with tileMap, but TileComposite.tiles will be use as the Map.
override fun draw(tileMap: Map<Position, Tile>, drawPosition: Position)
Same as draw with 3 parameters, with the difference that size will be used for drawArea.
override fun draw(tile: Tile, drawPosition: Position)
Draws the given Tile on this TileGraphics at the given drawPosition.
override fun draw(tileComposite: TileComposite, drawPosition: Position)
Same as draw with tileMap, but TileComposite.tiles will be use as the Map.
override fun draw(tileMap: Map<Position, Tile>, drawPosition: Position, drawArea: Size)
Draws the given tileMap onto this TileGraphics.
override fun draw(tileComposite: TileComposite, drawPosition: Position, drawArea: Size)
Same as draw with tileMap, but TileComposite.tiles will be use as the Map.
drawAbsoluteTileAt
Link copied to clipboard
common
override fun drawAbsoluteTileAt(position: Position, tile: Tile)
Same as TileGraphics.draw but will consider the given position as an absolute position (the position is relative to the top left corner of the screen, not the top left corner of the Layer).
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
fill
Link copied to clipboard
common
override fun fill(filler: Tile)
Fills the empty parts of this TileGraphics with the given filler.
getAbsoluteTileAt
Link copied to clipboard
common
override fun getAbsoluteTileAt(position: Position): Maybe<Tile>
Same as TileGraphics.getTileAt but will consider the given position as an absolute position (the position is relative to the top left corner of the screen, not the top left corner of the Layer).
getTileAt
Link copied to clipboard
common
open override fun getTileAt(position: Position): Maybe<Tile>
getTileAtOrNull
Link copied to clipboard
common
open override fun getTileAtOrNull(position: Position): Tile?
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
intersects
Link copied to clipboard
common
open infix override fun intersects(boundable: Boundable): Boolean
moveBy
Link copied to clipboard
common
open override fun moveBy(position: Position): Boolean
moveDownBy
Link copied to clipboard
common
open override fun moveDownBy(delta: Int): Boolean
moveLeftBy
Link copied to clipboard
common
open override fun moveLeftBy(delta: Int): Boolean
moveRightBy
Link copied to clipboard
common
open override fun moveRightBy(delta: Int): Boolean
moveTo
Link copied to clipboard
common
open override fun moveTo(position: Position): Boolean
Sets the position of this Movable.
moveUpBy
Link copied to clipboard
common
open override fun moveUpBy(delta: Int): Boolean
render
Link copied to clipboard
common
open override fun render(graphics: TileGraphics)
Renders this Renderable onto the given TileGraphics object.
toLayer
Link copied to clipboard
common
override fun toLayer(offset: Position): Layer
Creates a newLayer from the contents of this TileGraphics.
toResized
Link copied to clipboard
common
override fun toResized(newSize: Size): TileGraphics
Returns a copy of this TileGraphics resized to a new size and using Tile.empty if the new size is larger than the old and it needs to fill in empty areas.
override fun toResized(newSize: Size, filler: Tile): TileGraphics
Returns a copy of this image resized to a new size and using the specified filler if the new size is larger than the old one and we need to fill in empty areas.
toString
Link copied to clipboard
common
open override fun toString(): String
toSubTileGraphics
Link copied to clipboard
common
override fun toSubTileGraphics(rect: Rect): SubTileGraphics
This function can be used to create an editable "window" over the underlying TileGraphics.
toTileImage
Link copied to clipboard
common
override fun toTileImage(): TileImage
Creates a newTileImage from the contents of this TileGraphics.
transform
Link copied to clipboard
common
override fun transform(transformer: (Position, Tile) -> Tile)
Transforms all of the Tiles in this TileGraphics with the given transformer and overwrites them with the results of calling transformer.

Properties

height
Link copied to clipboard
common
override val height: Int
hiddenProperty
Link copied to clipboard
common
override val hiddenProperty: Property<Boolean>
id
Link copied to clipboard
common
override val id: UUID
isHidden
Link copied to clipboard
common
override var isHidden: Boolean
position
Link copied to clipboard
common
open override val position: Position
rect
Link copied to clipboard
common
override val rect: Rect
A Rect contains the coordinates and the size of a Boundable.
rectValue
Link copied to clipboard
common
open override val rectValue: ObservableValue<Rect>
size
Link copied to clipboard
common
override val size: Size
tiles
Link copied to clipboard
common
open override val tiles: Map<Position, Tile>
tileset
Link copied to clipboard
common
open override var tileset: TilesetResource
tilesetProperty
Link copied to clipboard
common
open override val tilesetProperty: Property<TilesetResource>
width
Link copied to clipboard
common
override val width: Int
x
Link copied to clipboard
common
open override val x: Int
y
Link copied to clipboard
common
open override val y: Int

Sources

(source)
Link copied to clipboard