Skip to content

Documentation

maklore edited this page Jul 22, 2026 · 21 revisions

.initialise(_fontASSET, _fontColour, [_soundASSET], [_fontDrawEach])

Chitter().initialise(fontASSET, fontColour);

Initialises Chitter.

The system creates sprites for each font asset.

ARGUMENT TYPE DESCRIPTION
_fontASSET Asset.GMFont Base font
_fontColour Constant.colour or Real Base font colour
[_soundASSET] Asset.GMSound Base sound
[_fontDrawEach] Bool Set to true if using a non monospace font and/or using font_swap tag

Using a non monospace font draws each letter

at a time compared to the the alternative.

As such it uses more resources.

.add(_id, _speaker_name, _speaker_string, [_speaker_sprite])

Add name, modified string, and sprite of the speaker to a queue system.

ARGUMENT TYPE DESCRIPTION
_id string Queue ID
_speaker_name String String name of speaker
_speaker_string String String or modified string of the speaker.
[_speaker_sprite] Asset.GMSprite Sprite asset of speaker

Examples:

The substring "blue" will draw in a blue colour.

Chitter().add("0_0", "Maklore", "Here is a [colour : #0000ff]blue[] colour.");

You can also use multi-line string literals.

Chitter().add("0_0", "Maklore",@"Here is a [colour : #0000ff]blue[] colour.
Here is a new line with a [colour : #00ff00]green[] colour.");

Modifiers can not span over multiple lines. Must be per line.

There is no automatic line break for normal strings.

Please use multi-line string literals or \n if you want line breaks.

Modifiers must at minimum have one character space between

starting and closing tags. "[wait_seconds : 2] []".

Will be ignored otherwise.

.queue_empty(_id)

Chitter().queue_empty("0_0");
ARGUMENT TYPE DESCRIPTION
_id string Queue ID

Returns true if queue is empty.

.get_active_speaker_name()

Chitter().get_active_speaker_name();

Returns current active speaker name set in .add() or added through modifier tags, else returns 0.

.get_active_speaker_sprite()

Chitter().get_active_speaker_sprite();

Returns current active speaker sprite set in .add() or added through modifier tags, else returns 0.

.next(_id)

Chitter().next("0_0");

Sends the modified string from the queue to be drawn, and removes it from the queue.

Returns -1 if there are no more strings in the queue.

Returns 0 if typewriter skip is triggered.

Returns 1 if new string is sent to draw.

ARGUMENT TYPE DESCRIPTION
_id string Queue ID

While the modified string is being drawn, calling this again will auto skip the drawing and display the whole string modified.

If the whole string is displayed, calling it again will send the next (if there is one) modified string to be drawn.

Example to call function:

if keyboard_check_pressed(vk_space) {
	Chitter().next("0_0");
}

Recommend adding it to a triggered event of an object.

.draw(_x, _y)

Chitter().draw(_x, _y);

Draw the modified string.

ARGUMENT TYPE DESCRIPTION
_x REAL X position of modified string to be drawn
_y REAL Y position of modified string to be drawn

Recommend adding it to the draw GUI event of an object.

.cleanup()

Chitter().cleanup();

Removes all font sprites created at .initialise() from memory.