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

Method resize

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

* change the font display size * @param {number} scale - ratio * @returns {BitmapText} this object for chaining

(scale)

Source from the content-addressed store, hash-verified

323 * @returns {BitmapText} this object for chaining
324 */
325 resize(scale) {
326 this.fontScale.set(scale, scale);
327
328 // remeasure with new scale (cached for updateBounds)
329 this.metrics.measureText(this._text);
330 this.updateBounds();
331
332 this.isDirty = true;
333
334 return this;
335 }
336
337 /**
338 * measure the given text size in pixels

Callers 5

constructorMethod · 0.95
setMethod · 0.95
constructorMethod · 0.45
setTextMethod · 0.45
constructorMethod · 0.45

Calls 3

updateBoundsMethod · 0.95
setMethod · 0.45
measureTextMethod · 0.45

Tested by

no test coverage detected