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