Skip to content

melon.text

garryspins edited this page Feb 27, 2026 · 4 revisions

melon.text


client link

Misc text handling functions
melon

Functions

melon.text.AddDelimiter

client link
melon.text.AddDelimiter(delimiter: char)

Argument and Return information

Arguments

# Name Type Description
1 delimiter char Character to count as a delimiter

Adds a delimiter for string splitting, wrapping, selection, etc

melon.text.Ellipses

client link
melon.text.Ellipses(text: string, font: string, w: number) -> string

Argument and Return information

Arguments

# Name Type Description
1 text string Text to cut
2 font string Font to scale the text with
3 w number Maximum width of the text

Returns

# Name Type Description
1 text string Cut text
Crops text and ends it with ... if it fills the given width or more. VERY SLOW, cache this result.

melon.text.Wrap

client link
melon.text.Wrap(text: string, font: string, w: number, x: number, notrim: bool) -> table

Argument and Return information

Arguments

# Name Type Description
1 text string String to process
2 font string Font of the text
3 w number Maximum width of the wrapped text
4 x number Optional, Starting X pos of the text
5 notrim bool Optional, Dont trim the left of each line

Returns

# Name Type Description
1 lines table Table of all lines wrapped
Wraps the given text based on newlines and text width, breaks word if it cant resolve a better way. VERY SLOW, cache this result.

Clone this wiki locally