* set the camera boundaries (set to the world limit by default). * the camera is bound to the given coordinates and cannot move/be scrolled outside of it. * @param x - world left limit * @param y - world top limit * @param w - world width limit * @param h - world height limit
(x: number, y: number, w: number, h: number)
| 514 | * @param h - world height limit |
| 515 | */ |
| 516 | setBounds(x: number, y: number, w: number, h: number): void { |
| 517 | this.smoothFollow = false; |
| 518 | this.bounds.setMinMax(x, y, w + x, h + y); |
| 519 | this.moveTo(this.pos.x, this.pos.y); |
| 520 | this.update(); |
| 521 | this.smoothFollow = true; |
| 522 | } |
| 523 | |
| 524 | /** |
| 525 | * set the camera to follow the specified renderable. <br> |