ANSI¶
These strings can be embedded in text when writing to a StdStream to create a text-based UI.
primitive val ANSI
Constructors¶
create¶
new val create()
: ANSI val^
Returns¶
- ANSI val^
Public Functions¶
up¶
Move the cursor up n lines. 0 is the same as 1.
fun box up(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
down¶
Move the cursor down n lines. 0 is the same as 1.
fun box down(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
right¶
Move the cursor right n columns. 0 is the same as 1.
fun box right(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
left¶
Move the cursor left n columns. 0 is the same as 1.
fun box left(
n: U32 val = 0)
: String val
Parameters¶
- n: U32 val = 0
Returns¶
- String val
cursor¶
Move the cursor to line y, column x. 0 is the same as 1. This indexes from the top left corner of the screen.
fun box cursor(
x: U32 val = 0,
y: U32 val = 0)
: String val
Parameters¶
Returns¶
- String val
clear¶
Clear the screen and move the cursor to the top left corner.
fun box clear()
: String val
Returns¶
- String val
erase¶
Erases everything to the left of the cursor on the line the cursor is on.
fun box erase()
: String val
Returns¶
- String val
reset¶
Resets all colours and text styles to the default.
fun box reset()
: String val
Returns¶
- String val
bold¶
Bold text. Does nothing on Windows.
fun box bold(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
underline¶
Underlined text. Does nothing on Windows.
fun box underline(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
blink¶
Blinking text. Does nothing on Windows.
fun box blink(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
reverse¶
Swap foreground and background colour.
fun box reverse(
state: Bool val = true)
: String val
Parameters¶
- state: Bool val = true
Returns¶
- String val
black¶
Black text.
fun box black()
: String val
Returns¶
- String val
red¶
Red text.
fun box red()
: String val
Returns¶
- String val
green¶
Green text.
fun box green()
: String val
Returns¶
- String val
yellow¶
Yellow text.
fun box yellow()
: String val
Returns¶
- String val
blue¶
Blue text.
fun box blue()
: String val
Returns¶
- String val
magenta¶
Magenta text.
fun box magenta()
: String val
Returns¶
- String val
cyan¶
Cyan text.
fun box cyan()
: String val
Returns¶
- String val
grey¶
Grey text.
fun box grey()
: String val
Returns¶
- String val
white¶
White text.
fun box white()
: String val
Returns¶
- String val
bright_red¶
Bright red text.
fun box bright_red()
: String val
Returns¶
- String val
bright_green¶
Bright green text.
fun box bright_green()
: String val
Returns¶
- String val
bright_yellow¶
Bright yellow text.
fun box bright_yellow()
: String val
Returns¶
- String val
bright_blue¶
Bright blue text.
fun box bright_blue()
: String val
Returns¶
- String val
bright_magenta¶
Bright magenta text.
fun box bright_magenta()
: String val
Returns¶
- String val
bright_cyan¶
Bright cyan text.
fun box bright_cyan()
: String val
Returns¶
- String val
bright_grey¶
Bright grey text.
fun box bright_grey()
: String val
Returns¶
- String val
black_bg¶
Black background.
fun box black_bg()
: String val
Returns¶
- String val
red_bg¶
Red background.
fun box red_bg()
: String val
Returns¶
- String val
green_bg¶
Green background.
fun box green_bg()
: String val
Returns¶
- String val
yellow_bg¶
Yellow background.
fun box yellow_bg()
: String val
Returns¶
- String val
blue_bg¶
Blue background.
fun box blue_bg()
: String val
Returns¶
- String val
magenta_bg¶
Magenta background.
fun box magenta_bg()
: String val
Returns¶
- String val
cyan_bg¶
Cyan background.
fun box cyan_bg()
: String val
Returns¶
- String val
grey_bg¶
Grey background.
fun box grey_bg()
: String val
Returns¶
- String val
white_bg¶
White background.
fun box white_bg()
: String val
Returns¶
- String val
bright_red_bg¶
Bright red background.
fun box bright_red_bg()
: String val
Returns¶
- String val
bright_green_bg¶
Bright green background.
fun box bright_green_bg()
: String val
Returns¶
- String val
bright_yellow_bg¶
Bright yellow background.
fun box bright_yellow_bg()
: String val
Returns¶
- String val
bright_blue_bg¶
Bright blue background.
fun box bright_blue_bg()
: String val
Returns¶
- String val
bright_magenta_bg¶
Bright magenta background.
fun box bright_magenta_bg()
: String val
Returns¶
- String val
bright_cyan_bg¶
Bright cyan background.
fun box bright_cyan_bg()
: String val
Returns¶
- String val
bright_grey_bg¶
Bright grey background.
fun box bright_grey_bg()
: String val
Returns¶
- String val
eq¶
fun box eq(
that: ANSI val)
: Bool val
Parameters¶
- that: ANSI val
Returns¶
- Bool val
ne¶
fun box ne(
that: ANSI val)
: Bool val
Parameters¶
- that: ANSI val
Returns¶
- Bool val