MCPcopy Create free account
hub / github.com/codecombat/codecombat / zoomToCommand

Method zoomToCommand

ozaria/engine/cinematic/CameraSystem.js:16–29  ·  view source on GitHub ↗
({ x, y }, zoom)

Source from the content-addressed store, hash-verified

14 }
15
16 zoomToCommand ({ x, y }, zoom) {
17 const lastPosition = this.lastCameraMove
18 this.lastCameraMove = { pos: { x, y }, zoom }
19 const cameraZoomCommand = new SyncFunction(() => this.camera.zoomTo({ x, y }, zoom, 0))
20 cameraZoomCommand.undoCommandFactory = () => {
21 if (lastPosition) {
22 return new SyncFunction(() => {
23 const { pos: { x, y }, zoom } = lastPosition
24 this.camera.zoomTo({ x, y }, zoom, 0)
25 })
26 }
27 }
28 return cameraZoomCommand
29 }
30
31 /**
32 * May return command to reposition camera.

Callers 2

parseSetupShotMethod · 0.95
parseDialogNodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected