Skip to content

MorseCode

Michael edited this page Aug 27, 2022 · 2 revisions

Normally, the game dev tools I made came about because I needed them for something, and then decided that some other people might have a use for them as well. This is not one of those things. I have no idea why I decided to make this. I was bored.

Relevant Links

morse_encode(str)

Returns: string

Parameter Type Description
str string The text string to convert to Morse code.

Encodes a string as morse code. Supported characters all of these except for the non-Latin character variants.

Characters are separated by a space; spaces are represented by a forward slash.

morse_decode(str)

Returns: string

Parameter Type Description
str string The Morse-encoded string to convert back to text.

Does the opposite of the other function.

Note that Morse code is case-insensitive; abc is considered to be the same as ABC. This function will return an all-lowercase string.

morse_play_text(text)

Returns: N/A

Parameter Type Description
text string The plain text to be played back as Morse code

Plays back text in Morse code as a series of dots and dashes. The sound files (and the delays between letters, etc) can be found in the Morse Code folder that you imported.

morse_play(dotsanddashes)

Returns: N/A

Parameter Type Description
dotsanddashes string The encoded string to be played back

Does the same thing as the other function but you supply it an already-encoded string of text.

Configuration

We've also got a few macros that can be set, to affect audio playback.

MORSE_CODE_SOUND_PRIORITY

See the GameMaker manual page on audio playback and sound priority.

MORSE_CODE_SOUND_VOLUME 1

The default volume of the dot and dash sounds. Ranges from 0 to 1. Defaults to full volume.

Clone this wiki locally