Skip to main content

DrawingGetTextSize

Gets the text size needed to fit inside a given width according to the current font. This function is memoized because

<code>
MainCanvas.measureText(Text)
</code>
is a major resource hog.

@param

Text to draw

@param

Width in which the text has to fit

@returns
  • Text to draw and its font size

Callable

  • DrawingGetTextSize(Text, Width): [text: string, size: number]

  • Parameters

    • Text: string
    • Width: number

    Returns [text: string, size: number]

Index

Methods

Methods

clearCache

  • clearCache(): void
  • Clears the cache of the memoized function


    Returns void

Page Options