TerminalEmulator

roguelikestarterkit.terminal.TerminalEmulator
See theTerminalEmulator companion object
final case class TerminalEmulator(size: Size, charMap: SparseGrid[MapTile]) extends Terminal

TerminalEmulator represents an immutable, sparsely populated terminal.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Terminal
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Remove all values from the terminal, behaviour varies by implementation.

Remove all values from the terminal, behaviour varies by implementation.

Attributes

def combine(otherConsole: Terminal): TerminalEmulator

Merge two terminals together

Merge two terminals together

Attributes

def delete(coords: Point): TerminalEmulator

Removes an entry from the terminal, implementations vary.

Removes an entry from the terminal, implementations vary.

Attributes

def fill(mapTile: MapTile): TerminalEmulator

Fill the whole terminal with the supplied value

Fill the whole terminal with the supplied value

Attributes

def fill(tile: Tile, foregroundColor: RGBA, backgroundColor: RGBA): TerminalEmulator

Fill the whole terminal with the supplied value

Fill the whole terminal with the supplied value

Attributes

def fillCircle(circle: Circle, mapTile: MapTile): TerminalEmulator
def fillCircle(circle: Circle, tile: Tile): TerminalEmulator
def fillCircle(circle: Circle, tile: Tile, foreground: RGBA): TerminalEmulator
def fillCircle(circle: Circle, tile: Tile, foreground: RGBA, background: RGBA): TerminalEmulator
def fillLine(line: LineSegment, mapTile: MapTile): TerminalEmulator
def fillLine(line: LineSegment, tile: Tile): TerminalEmulator
def fillLine(line: LineSegment, tile: Tile, foreground: RGBA): TerminalEmulator
def fillLine(line: LineSegment, tile: Tile, foreground: RGBA, background: RGBA): TerminalEmulator
def fillLine(from: Point, to: Point, mapTile: MapTile): TerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile): TerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile, foreground: RGBA): TerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile, foreground: RGBA, background: RGBA): TerminalEmulator
def fillRectangle(region: Rectangle, mapTile: MapTile): TerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile): TerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile, foreground: RGBA): TerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile, foreground: RGBA, background: RGBA): TerminalEmulator
def get(coords: Point): Option[MapTile]

Retrieves the MapTile at a given point, if one is present.

Retrieves the MapTile at a given point, if one is present.

Attributes

def inset(otherConsole: Terminal, offset: Point): TerminalEmulator

Inset one terminal inside another at some position offset.

Inset one terminal inside another at some position offset.

Attributes

def map(modifier: (Point, MapTile) => MapTile): TerminalEmulator
def mapCircle(circle: Circle)(modifier: (Point, MapTile) => MapTile): TerminalEmulator
def mapLine(from: Point, to: Point)(modifier: (Point, MapTile) => MapTile): TerminalEmulator
def mapLine(line: LineSegment)(modifier: (Point, MapTile) => MapTile): TerminalEmulator
def mapRectangle(region: Rectangle)(modifier: (Point, MapTile) => MapTile): TerminalEmulator
def modifyAt(position: Point)(modifier: MapTile => MapTile): TerminalEmulator
def put(coords: Point, tile: Tile, fgColor: RGBA, bgColor: RGBA): TerminalEmulator

Put the tile at the given point

Put the tile at the given point

Attributes

def put(coords: Point, tile: Tile, fgColor: RGBA): TerminalEmulator

Put the tile at the given point

Put the tile at the given point

Attributes

def put(coords: Point, tile: Tile): TerminalEmulator

Put the Tile at the given point

Put the Tile at the given point

Attributes

def put(tiles: Batch[(Point, MapTile)]): TerminalEmulator

Put a batch of tiles into the terminal at the positions specified

Put a batch of tiles into the terminal at the positions specified

Attributes

def put(tiles: Batch[(Point, MapTile)], offset: Point): TerminalEmulator

Put a batch of tiles into the terminal at the positions specified, with an offset.

Put a batch of tiles into the terminal at the positions specified, with an offset.

Attributes

def put(tiles: (Point, MapTile)*): TerminalEmulator

Put a batch of tiles into the terminal at the positions specified

Put a batch of tiles into the terminal at the positions specified

Attributes

def put(coords: Point, mapTile: MapTile): TerminalEmulator

Put the MapTile at the given point

Put the MapTile at the given point

Attributes

def putLine(startCoords: Point, text: String, fgColor: RGBA, bgColor: RGBA): TerminalEmulator

Adds a line of text to the terminal. No attempt is made to wrap text.

Adds a line of text to the terminal. No attempt is made to wrap text.

Attributes

def putLines(startCoords: Point, textLines: Batch[String], fgColor: RGBA, bgColor: RGBA): TerminalEmulator

Add many lines to the terminal

Add many lines to the terminal

Attributes

def putTileLine(startCoords: Point, tiles: Batch[Tile], fgColor: RGBA, bgColor: RGBA): TerminalEmulator
def putTileLines(startCoords: Point, textLines: Batch[Batch[Tile]], fgColor: RGBA, bgColor: RGBA): TerminalEmulator
def toASCII(nullReplacement: Tile): String
def toASCII: String
def toBatch: Batch[MapTile]

Returns all MapTiles, does not guarantee order, does not fill in gaps.

Returns all MapTiles, does not guarantee order, does not fill in gaps.

Attributes

def toBatch(region: Rectangle): Batch[MapTile]

Returns all MapTiles in a given region, does not guarantee order, does not fill in gaps.

Returns all MapTiles in a given region, does not guarantee order, does not fill in gaps.

Attributes

def toPositionedBatch: Batch[(Point, MapTile)]

Returns all MapTiles with their grid positions, does not guarantee order (but the position is given), does not fill in gaps.

Returns all MapTiles with their grid positions, does not guarantee order (but the position is given), does not fill in gaps.

Attributes

def toPositionedBatch(region: Rectangle): Batch[(Point, MapTile)]

Returns all MapTiles with their grid positions in a given region, does not guarantee order (but the position is given), does not fill in gaps.

Returns all MapTiles with their grid positions in a given region, does not guarantee order (but the position is given), does not fill in gaps.

Attributes

def toTileBatch: Batch[MapTile]

Returns all MapTiles, guarantees order, inserts a default where there is a gap.

Returns all MapTiles, guarantees order, inserts a default where there is a gap.

Attributes

def toTileBatch(region: Rectangle): Batch[MapTile]

Returns all MapTiles in a given region, guarantees order, inserts a default where there is a gap.

Returns all MapTiles in a given region, guarantees order, inserts a default where there is a gap.

Attributes

def |+|(otherConsole: Terminal): TerminalEmulator

Merge two terminals together

Merge two terminals together

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def toCloneTiles(idPrefix: CloneId, position: Point, charCrops: Batch[(Int, Int, Int, Int)], region: Rectangle, modifier: (Point, MapTile) => (Point, Radians, Vector2))(makeBlank: (RGBA, RGBA) => Cloneable): TerminalClones

Export the terminal so that it can be rendered as CloneTiles for a defined region of the given map, and supply a modifier funtion to alter the relative position, rotation, and scale of the tile.

Export the terminal so that it can be rendered as CloneTiles for a defined region of the given map, and supply a modifier funtion to alter the relative position, rotation, and scale of the tile.

Attributes

Inherited from:
Terminal
def toCloneTiles(idPrefix: CloneId, position: Point, charCrops: Batch[(Int, Int, Int, Int)], modifier: (Point, MapTile) => (Point, Radians, Vector2))(makeBlank: (RGBA, RGBA) => Cloneable): TerminalClones

Export the terminal so that it can be rendered as CloneTiles, and supply a modifier funtion to alter the relative position, rotation, and scale of the tile.

Export the terminal so that it can be rendered as CloneTiles, and supply a modifier funtion to alter the relative position, rotation, and scale of the tile.

Attributes

Inherited from:
Terminal
def toCloneTiles(idPrefix: CloneId, position: Point, charCrops: Batch[(Int, Int, Int, Int)], region: Rectangle)(makeBlank: (RGBA, RGBA) => Cloneable): TerminalClones

Creates a TerminalClones instance of a defined region of the given map.

Creates a TerminalClones instance of a defined region of the given map.

Attributes

Inherited from:
Terminal
def toCloneTiles(idPrefix: CloneId, position: Point, charCrops: Batch[(Int, Int, Int, Int)])(makeBlank: (RGBA, RGBA) => Cloneable): TerminalClones

Creates a TerminalClones instance of the given map.

Creates a TerminalClones instance of the given map.

Attributes

Inherited from:
Terminal