GMConsole:
Filter:
GraphicalModule/Classes (extension) | GUI > Graphical Module

GMConsole
ExtensionExtension

A basic console output simulation to embed into graphical interfaces

Description

GMConsole emulates a console output. It displays a suite of messages along with their timestamp, and allows to cycle through them.

Class Methods

.new

Creates a new instance of GMConsole.

Its graphical properties are defined by its associated GMStyle.

Returns:

a GMConsole instance.

Instance Methods

Interaction

.postMsg

Post a new message to the console. This will set the console to display this message if the current message was the the last posted message. If the maximum number of messages is reached, this will remove the oldest message. If no string color is provided, the default color will be used.

.reset

Removes every messages and resets the console.

.removeLastMessage

Removes the last message. This can be useful if you are constantly posting a parameter modification, but only want to keep trace of the most recent modification as long as the modified parameter does not change.

.previousMessage

Displays the previous message.

.nextMessage

Displays the next message.

.lastMessage

Displays the most recent message.

.listMaxSize

Sets or gets the maximum number of messages that will be kept in memory. Defaults to inf.

.msgList

Returns the full message list.

Visual Properties

.fontRatio

Sets or gets the font ratio relative to the height of the widget.

.defaultStringColor

Sets or gets the color that will be used to display messages if no color is specified when posting the message.

Internal Methods

.draw

The function associated to the View's drawFunc. Shouldn't be modified.

.prDrawLastButton

.prDrawNextButton

.prDrawPreviousButton

.prGetColor

.prUpdateFont

Examples