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

Method measureText

packages/melonjs/src/renderable/text/bitmaptext.js:342–344  ·  view source on GitHub ↗

* measure the given text size in pixels * @param {string} [text] * @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions

(text = this._text)

Source from the content-addressed store, hash-verified

340 * @returns {TextMetrics} a TextMetrics object with two properties: `width` and `height`, defining the output dimensions
341 */
342 measureText(text = this._text) {
343 return this.metrics.measureText(text);
344 }
345
346 /**
347 * draw the bitmap font

Callers 3

onResetEventMethod · 0.95
setTextMethod · 0.45
resizeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected