MCPcopy Create free account
hub / github.com/melonjs/melonJS / measureText

Method measureText

packages/melonjs/src/renderable/text/text.js:432–434  ·  view source on GitHub ↗

* measure the given text size in pixels * @param {string} [text] - the text to be measured * @returns {TextMetrics} a TextMetrics object defining the dimensions of the given piece of text

(text = this._text)

Source from the content-addressed store, hash-verified

430 * @returns {TextMetrics} a TextMetrics object defining the dimensions of the given piece of text
431 */
432 measureText(text = this._text) {
433 return this.metrics.measureText(text, this.canvasTexture.context);
434 }
435
436 /**
437 * draw a text at the specified coord

Callers 4

onResetEventMethod · 0.95
constructorMethod · 0.45
setTextMethod · 0.45
font.spec.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected