* move the camera upper-left position to the specified coordinates * @see focusOn * @param x - horizontal position * @param y - vertical position
(x: number, y: number)
| 588 | * @param y - vertical position |
| 589 | */ |
| 590 | moveTo(x: number, y: number): void { |
| 591 | const _x = this.pos.x; |
| 592 | const _y = this.pos.y; |
| 593 | |
| 594 | this.pos.x = clamp(x, this.bounds.left, this.bounds.width - this.width); |
| 595 | this.pos.y = clamp(y, this.bounds.top, this.bounds.height - this.height); |
| 596 | |
| 597 | //publish the VIEWPORT_ONCHANGE event if necessary |
| 598 | if (_x !== this.pos.x || _y !== this.pos.y) { |
| 599 | this.isDirty = true; |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /** @ignore */ |
| 604 |
no test coverage detected