new Camera(game, id, x, y, width, height)
A Camera is your view into the game world. It has a position and size and renders only those objects within its field of view.
The game automatically creates a single Stage sized camera on boot. Move the camera around the world with Phaser.Camera.x/y
Parameters
Name | Type | Description |
---|---|---|
game | Phaser.Game | Game reference to the currently running game. |
id | number | Not being used at the moment, will be when Phaser supports multiple camera |
x | number | Position of the camera on the X axis |
y | number | Position of the camera on the Y axis |
width | number | The width of the view rectangle |
height | number | The height of the view rectangle |
- Source code: core/Camera.js (Line 20)
Please login to continue.