center Camera At
Center the camera view at a location in the scene.
The size of your scene might be larger that the screen size. To move a part of the scene into the view of the screen, you can set the camera view to center at a location in the scene.
Parameters
- x: a number that’s the horizontal location of the scene to center the camera view at.
- y: a number that’s the vertical location of the scene to centere the camera view at.
Example
Make a tile map that’s 1.5 times the size of the screen. Draw a “X” pattern in the scene with tiles. Randomly center the camera view to each corner of the scene.
See also
camera follow sprite