ChildTerminal class
A Terminal representing a subset of a parent Terminal. Will always be fully-enclosed by the parent terminal. Useful for drawing UI elements without needing to keep track of offsets.
Constructors
- ChildTerminal.new(Vec2 _position, Vec2 _size, Terminal _root)
Properties
- background ↔ Color
-
The default background color when none is specified
getter/setter pairinherited
- bounds → Rect
-
The bounds of this terminal as a Rect
no setterinherited
- foreground ↔ Color
-
The default foreground color when none is specified
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
The height of the terminal screen in rows of characters
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → Vec2
-
The size of the terminal as a vector
no setteroverride
- width → int
-
The width of the terminal screen in columns of characters
no setteroverride
Methods
-
boundsCheck(
int x, int y) → void -
Ensures that the given position
x
,y
is within the bounds of this Terminalinherited -
child(
int x, int y, int width, int height) → Terminal -
Flatten out child terminals to always draw onto the same root
override
-
childRect(
Rect rect) → Terminal -
Get a child Terminal within this one, defined by the given
rect
.inherited -
clear(
) → void -
Clears the entire terminal with empty characters using the current
background Color.
inherited
-
drawChar(
int x, int y, Char char) → void -
Most basic draw method for the terminal; draws the given Char at column
x
, rowy
of this Terminal.override -
drawCharCode(
int x, int y, int charCode, [Color? foreground, Color? background]) → void -
Draws a character at column
x
, rowy
of this Terminal using its integercharCode
using the givenforeground
andbackground
Colors (or default colors).inherited -
drawText(
int x, int y, String text, [Color? foreground, Color? background]) → void -
Draws the string of characters in
text
starting at columnx
, rowy
of this Terminal using the givenforeground
andbackground
Colors (or default colors). The text will be truncated if it runs beyond the bounds of the terminal.inherited -
drawTextCenter(
int y, String text, [Color? foreground, Color? background]) → void -
Draws the string of characters in
text
on rowy
such that the text is centered horizontally in this Terminal. If the length oftext
is longer than this terminal's width, the text will be positioned at column 0.inherited -
fill(
int x, int y, int width, int height, [Color? color]) → void -
Clears and fills the given rectangle with the given (or default)
background Color.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited