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

Method scale

packages/spine-plugin/src/Spine.js:304–313  ·  view source on GitHub ↗

* Scale the Spine object around its anchor point. * @param {number} x - a number representing the abscissa of the scaling vector. * @param {number} [y=x] - a number representing the ordinate of the scaling vector. * @returns {Spine} Reference to this object for method chaining

(x, y = x)

Source from the content-addressed store, hash-verified

302 * @returns {Spine} Reference to this object for method chaining
303 */
304 scale(x, y = x) {
305 if (this.isWebGL) {
306 // WebGL: SpineBatcher ignores currentTransform, scale through root bone
307 this.root.pose.scaleX *= x;
308 this.root.pose.scaleY *= y;
309 }
310 // Canvas: scale through currentTransform only (applied by preDraw),
311 // which scales both region bone transforms and mesh world vertices uniformly
312 return super.scale(x, y);
313 }
314
315 /**
316 * Update the bounding box for this spine object.

Callers 15

loadCharacterFunction · 0.95
drawRegionMethod · 0.45
onResetEventMethod · 0.45
spawnContrailNodeMethod · 0.45
updateContrailMethod · 0.45
createGameFunction · 0.45
constructorMethod · 0.45
createGameFunction · 0.45
constructorMethod · 0.45
updateMethod · 0.45
updateMethod · 0.45
onResetEventMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected