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

Method move

packages/melonjs/src/camera/camera2d.ts:580–582  ·  view source on GitHub ↗

* move the camera upper-left position by the specified offset. * @see focusOn * @param x - horizontal offset * @param y - vertical offset * @example * // Move the camera up by four pixels * app.viewport.move(0, -4);

(x: number, y: number)

Source from the content-addressed store, hash-verified

578 * app.viewport.move(0, -4);
579 */
580 move(x: number, y: number): void {
581 this.moveTo(this.pos.x + x, this.pos.y + y);
582 }
583
584 /**
585 * move the camera upper-left position to the specified coordinates

Callers 2

camera.spec.jsFile · 0.80
onKeyPressedFunction · 0.80

Calls 1

moveToMethod · 0.95

Tested by

no test coverage detected