RogueTerminalEmulator

roguelikestarterkit.terminal.RogueTerminalEmulator
See theRogueTerminalEmulator companion object
final class RogueTerminalEmulator(val size: Size, _tiles: Array[Tile], _foreground: Array[RGBA], _background: Array[RGBA]) extends Terminal

RogueTerminalEmulator is like the TerminalEmulator but a little more daring and dangerous. Represents an mutable, packed populated terminal. It is more performant, relative to TerminalEmulator, but also requires more care since it's a mutable structure. There are no empty spaces in this terminal, empty tiles are filled with the Tile.Null value and RGBA.Zero colors.

Attributes

Companion
object
Graph
Supertypes
trait Terminal
class Object
trait Matchable
class Any

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

override def clone(): RogueTerminalEmulator

Create a copy of the receiver object.

Create a copy of the receiver object.

The default implementation of the clone method is platform dependent.

Attributes

Returns

a copy of the receiver object.

Note

not specified by SLS as a member of AnyRef

Definition Classes
Object
def combine(otherConsole: Terminal): RogueTerminalEmulator

Merge two terminals together

Merge two terminals together

Attributes

def delete(coords: Point): RogueTerminalEmulator

Removes an entry from the terminal, implementations vary.

Removes an entry from the terminal, implementations vary.

Attributes

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

Fill the whole terminal with the supplied value

Fill the whole terminal with the supplied value

Attributes

Fill the whole terminal with the supplied value

Fill the whole terminal with the supplied value

Attributes

def fillCircle(circle: Circle, mapTile: MapTile): RogueTerminalEmulator
def fillCircle(circle: Circle, tile: Tile): RogueTerminalEmulator
def fillCircle(circle: Circle, tile: Tile, foreground: RGBA): RogueTerminalEmulator
def fillCircle(circle: Circle, tile: Tile, foreground: RGBA, background: RGBA): RogueTerminalEmulator
def fillLine(line: LineSegment, mapTile: MapTile): RogueTerminalEmulator
def fillLine(line: LineSegment, tile: Tile): RogueTerminalEmulator
def fillLine(line: LineSegment, tile: Tile, foreground: RGBA): RogueTerminalEmulator
def fillLine(line: LineSegment, tile: Tile, foreground: RGBA, background: RGBA): RogueTerminalEmulator
def fillLine(from: Point, to: Point, mapTile: MapTile): RogueTerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile): RogueTerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile, foreground: RGBA): RogueTerminalEmulator
def fillLine(from: Point, to: Point, tile: Tile, foreground: RGBA, background: RGBA): RogueTerminalEmulator
def fillRectangle(region: Rectangle, mapTile: MapTile): RogueTerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile): RogueTerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile, foreground: RGBA): RogueTerminalEmulator
def fillRectangle(region: Rectangle, tile: Tile, foreground: RGBA, background: RGBA): RogueTerminalEmulator
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): RogueTerminalEmulator

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): RogueTerminalEmulator
def mapCircle(circle: Circle)(modifier: (Point, MapTile) => MapTile): RogueTerminalEmulator
def mapLine(from: Point, to: Point)(modifier: (Point, MapTile) => MapTile): RogueTerminalEmulator
def mapLine(line: LineSegment)(modifier: (Point, MapTile) => MapTile): RogueTerminalEmulator
def mapRectangle(region: Rectangle)(modifier: (Point, MapTile) => MapTile): RogueTerminalEmulator
def modifyAt(position: Point)(modifier: MapTile => MapTile): RogueTerminalEmulator
def put(coords: Point, tile: Tile, foregroundColor: RGBA, backgroundColor: RGBA): RogueTerminalEmulator

Put the tile at the given point

Put the tile at the given point

Attributes

def put(coords: Point, tile: Tile, foregroundColor: RGBA): RogueTerminalEmulator

Put the tile at the given point

Put the tile at the given point

Attributes

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

Put the Tile at the given point

Put the Tile at the given point

Attributes

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

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): RogueTerminalEmulator

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)*): RogueTerminalEmulator

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): RogueTerminalEmulator

Put the MapTile at the given point

Put the MapTile at the given point

Attributes

def putLine(startCoords: Point, text: String, foregroundColor: RGBA, backgroundColor: RGBA): RogueTerminalEmulator

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], foregroundColor: RGBA, backgroundColor: RGBA): RogueTerminalEmulator

Add many lines to the terminal

Add many lines to the terminal

Attributes

def putTileLine(startCoords: Point, tiles: Batch[Tile], foregroundColor: RGBA, backgroundColor: RGBA): RogueTerminalEmulator
def putTileLines(startCoords: Point, tileLines: Batch[Batch[Tile]], foregroundColor: RGBA, backgroundColor: RGBA): RogueTerminalEmulator
def toASCII(nullReplacement: Char): String
def toASCII: String
def toBatch: Batch[MapTile]

Returns all MapTiles, guarantees order.

Returns all MapTiles, guarantees order.

Attributes

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

Returns all MapTiles in a given region, guarantees order.

Returns all MapTiles in a given region, guarantees order.

Attributes

def toPositionedBatch: Batch[(Point, MapTile)]

Returns all MapTiles with their grid positions, guarantees order.

Returns all MapTiles with their grid positions, guarantees order.

Attributes

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

Returns all MapTiles with their grid positions in a given region, guarantees order.

Returns all MapTiles with their grid positions in a given region, guarantees order.

Attributes

def toTileBatch: Batch[MapTile]

Returns all MapTiles, guarantees order.

Returns all MapTiles, guarantees order.

Attributes

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

Returns all MapTiles in a given region, guarantees order.

Returns all MapTiles in a given region, guarantees order.

Attributes

def |+|(otherConsole: Terminal): RogueTerminalEmulator

Merge two terminals together

Merge two terminals together

Attributes

Inherited methods

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

Concrete fields

lazy val backgroundColors: Batch[RGBA]
lazy val foregroundColors: Batch[RGBA]
lazy val length: Int
val size: Size
lazy val tiles: Batch[Tile]