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

Method setSize

packages/melonjs/src/geometries/rectangle.ts:36–44  ·  view source on GitHub ↗

* Set new dimensions for the rectangle. * @param width - The new width of the rectangle. * @param height - The new height of the rectangle.

(width: number, height: number)

Source from the content-addressed store, hash-verified

34 * @param height - The new height of the rectangle.
35 */
36 setSize(width: number, height: number) {
37 this.points[0].set(0, 0); // 0, 0
38 this.points[1].set(width, 0); // 1, 0
39 this.points[2].set(width, height); // 1, 1
40 this.points[3].set(0, height); // 0, 1
41 this.recalc();
42 this.updateBounds();
43 return this;
44 }
45
46 /**
47 * The left coordinate of the Rectangle.

Callers 5

copyMethod · 0.95
resetFunction · 0.45
dispatchEventFunction · 0.45
rectangle.spec.tsFile · 0.45
roundrect.spec.tsFile · 0.45

Calls 3

setMethod · 0.45
recalcMethod · 0.45
updateBoundsMethod · 0.45

Tested by

no test coverage detected