Terminal

SplashKit Terminal allows you to read and write values to the terminal in a consistent manner.

Functions

Activate Advanced Terminal

Start using the advanced terminal. Once you call this you will need to make sure you call Refresh Terminal to show anything you have written. This will allow use of colors, bold, positioning, and other advanced options.

Signatures
void activate_advanced_terminal()
public static void Terminal.ActivateAdvancedTerminal();
public static void SplashKit.ActivateAdvancedTerminal();
procedure ActivateAdvancedTerminal()
def activate_advanced_terminal():

Advanced Terminal Active

Is the terminal currently in advanced mode?

Return Type

Boolean

True if the terminal is in advanced mode.

Signatures
bool advanced_terminal_active()
public static bool Terminal.AdvancedTerminalActive();
public static bool SplashKit.AdvancedTerminalActive();
function AdvancedTerminalActive(): Boolean
def advanced_terminal_active():

Clear Terminal

In advanced mode, this will clear the terminal to the background color you set in Set Terminal Color.

Signatures
void clear_terminal()
public static void Terminal.ClearTerminal();
public static void SplashKit.ClearTerminal();
procedure ClearTerminal()
def clear_terminal():

End Advanced Terminal

Finish using advanced mode. The existing terminal display will be lost and the user will see what was in the terminal before you called Activate Advanced Terminal.

Signatures
void end_advanced_terminal()
public static void Terminal.EndAdvancedTerminal();
public static void SplashKit.EndAdvancedTerminal();
procedure EndAdvancedTerminal()
def end_advanced_terminal():

Move Cursor To

In advanced mode, this will move the cursor to a given col, row of the terminal. You can check the terminal size using Terminal Width and Terminal Height. If you try to move outside this bounds then then move will not occur.

Parameters
Name Type Description
X

Integer

The column to move to, must be between 0 and Terminal Width

Y

Integer

The row to move to, must be between 0 and Terminal Height

Signatures
void move_cursor_to(int x, int y)
public static void Terminal.MoveCursorTo(int x, int y);
public static void SplashKit.MoveCursorTo(int x, int y);
procedure MoveCursorTo(x: Integer; y: Integer)
def move_cursor_to(x, y):

Read Character

Get a single character input by the user. This works in both standard and advanced modes. In advanced mode, you can set if the character should also be echoed to the terminal using Set Terminal Echo Input.

Return Type

Character

The character typed by the user.

Signatures
char read_char()
public static char Terminal.ReadChar();
public static char SplashKit.ReadChar();
function ReadChar(): Char
def read_char():

Read Line

Read a line of text from the terminal. The user will see the text as they type it.

Return Type

String

The text entered by the user.

Signatures
string read_line()
public static string Terminal.ReadLine();
public static string SplashKit.ReadLine();
function ReadLine(): String
def read_line():

Refresh Terminal

In advanced mode, this will display what has been written to the terminal. You need to call this for anything to be shown in advanced mode.

Signatures
void refresh_terminal()
public static void Terminal.RefreshTerminal();
public static void SplashKit.RefreshTerminal();
procedure RefreshTerminal()
def refresh_terminal():

Set Terminal Bold

In advanced mode, this allows you to set if the text should draw as bold.

Parameters
Name Type Description
Value

Boolean

Pass true to have the terminal write in bold

Signatures
void set_terminal_bold(bool value)
public static void Terminal.SetTerminalBold(bool value);
public static void SplashKit.SetTerminalBold(bool value);
procedure SetTerminalBold(value: Boolean)
def set_terminal_bold(value):

Set Terminal Colors

In advanced mode this allows you to set the color of the foreground and the background. The foreground is the color of the text.

Note that only the following colors are guaranteed to work on all Terminals (others may work):

Parameters
Name Type Description
Foreground

Color

The color of text that is drawn.

Background

Color

The color of the background behind drawn text.

Signatures
void set_terminal_colors(color foreground, color background)
public static void Terminal.SetTerminalColors(Color foreground, Color background);
public static void SplashKit.SetTerminalColors(Color foreground, Color background);
procedure SetTerminalColors(foreground: Color; background: Color)
def set_terminal_colors(foreground, background):

Set Terminal Echo Input

In advanced mode, this allows you to stop text read with Read Character appearing on the terminal. You can use this for reading passwords, or to control what is written.

Parameters
Name Type Description
Value

Boolean

Pass true if you want characters to appear as typed.

Signatures
void set_terminal_echo_input(bool value)
public static void Terminal.SetTerminalEchoInput(bool value);
public static void SplashKit.SetTerminalEchoInput(bool value);
procedure SetTerminalEchoInput(value: Boolean)
def set_terminal_echo_input(value):

Terminal Height

In advanced mode, this gives you the number of rows in the terminal.

Return Type

Integer

The number of rows in the terminal

Signatures
int terminal_height()
public static int Terminal.TerminalHeight();
public static int SplashKit.TerminalHeight();
function TerminalHeight(): Integer
def terminal_height():

Terminal Width

In advanced mode, this gives you the number of columns in the terminal.

Return Type

Integer

The number of columns in the terminal

Signatures
int terminal_width()
public static int Terminal.TerminalWidth();
public static int SplashKit.TerminalWidth();
function TerminalWidth(): Integer
def terminal_width():

Write

This function is overloaded. The following versions exist.

Write

Write the passed in data to the terminal.

Parameters
Name Type Description
Data

Double

The text to write

Signatures
void write(double data)
public static void Terminal.Write(double data);
public static void SplashKit.Write(double data);
procedure Write(data: Double)
def write_double(data):

Write

Write the passed in data to the terminal.

Parameters
Name Type Description
Data

Integer

The text to write

Signatures
void write(int data)
public static void Terminal.Write(int data);
public static void SplashKit.Write(int data);
procedure Write(data: Integer)
def write_int(data):

Write

Write the supplied text to the Terminal.

Parameters
Name Type Description
Text

String

The text to write

Signatures
void write(string text)
public static void Terminal.Write(string text);
public static void SplashKit.Write(string text);
procedure Write(text: String)
def write(text):

Write At

In advanced mode, this will write the supplied text at the indicated column and row.

Parameters
Name Type Description
Text

String

The text to write

X

Integer

The row to position the text at

Y

Integer

The column to position the text at

Signatures
void write_at(string text, int x, int y)
public static void Terminal.WriteAt(string text, int x, int y);
public static void SplashKit.WriteAt(string text, int x, int y);
procedure WriteAt(text: String; x: Integer; y: Integer)
def write_at(text, x, y):

Write Line

Write Line

Move to the next line/row of the terminal.

Signatures
void write_line()
public static void Terminal.WriteLine();
public static void SplashKit.WriteLine();
procedure WriteLine()
def write_line_empty():

Write Line

Write the passed in data, then move to the next line/row of the terminal.

Parameters
Name Type Description
Data

Double

The text to write

Signatures
void write_line(double data)
public static void Terminal.WriteLine(double data);
public static void SplashKit.WriteLine(double data);
procedure WriteLine(data: Double)
def write_line_double(data):

Write Line

Write the passed in data, then move to the next line/row of the terminal.

Parameters
Name Type Description
Data

Integer

The text to write

Signatures
void write_line(int data)
public static void Terminal.WriteLine(int data);
public static void SplashKit.WriteLine(int data);
procedure WriteLine(data: Integer)
def write_line_int(data):

Write Line

Write the passed in text, then move to the next line/row of the terminal.

Parameters
Name Type Description
Line

String

The text to write

Signatures
void write_line(string line)
public static void Terminal.WriteLine(string line);
public static void SplashKit.WriteLine(string line);
procedure WriteLine(line: String)
def write_line(line):