Methods
-
camera_fade(colour, time)
-
Fades the screen to the colour over the given amount of time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description colourcolour to fade the screen to
timeNumber how long to take to fade
Code Equivalent:
function toHexColor(color) { return color.replace("#", "0x"); } game.camera.fade(toHexColorFunc(colour), time, true); -
camera_flash(colour, time)
-
Fills the game with the colour specified, then fades the colour away over the given amount of time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description colourcolour to show
timeNumber how long to take to fade the colour away
Code Equivalent:
game.camera.flash(toHexColorFunc(colour), time, true); -
camera_focus_on(object)
-
Focus the camera on the given object.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description objectobject to focus on
Code Equivalent:
game.camera.focusOn(object); -
camera_focus_on_xy(posX, posY)
-
Focus the camera on the given location.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description posXNumber x position to focus on
posYNumber y position to focus on
Code Equivalent:
game.camera.focusOnXY(posX, posY); -
camera_reset()
-
Resets the camera by making it focus back to 0,0 and unfollowing all objects. Also resets any camera effects.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.camera.reset(); -
camera_reset_fx()
-
Resets any active camera effects.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.camera.resetFX(); -
camera_set_bounds_to_world()
-
Updates the camera bounds to match the game world bounds.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.camera.setBoundsToWorld(); -
camera_set_position(posX, posY)
-
Sets the game camera position.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description posXNumber x position for the camera
posYNumber y position for the camera
Code Equivalent:
game.camera.setPosition(posX, posY); -
camera_set_size(width, height)
-
Sets the size of the camera viewing rectangle.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description widthNumber the width of the camera view port
heightNumber the height of the camera view port
Code Equivalent:
game.camera.setSize(width, height); -
camera_shake(intensity, direction, duration)
-
Creates a camera shake effect by moving the camera randomly at the given intensity for the given amount of time.
Check out the third party documentation for a more in depth explanation.Parameters:
Name Type Description intensityNumber how much the camera should move while shaking
directionwhich direction the camera should shake
durationNumber how long the camera should shake
Code Equivalent:
game.camera.shake(intensity, duration, true, Phaser.Camera.direction); -
camera_unfollow()
-
Stops the camera from following all objects.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.camera.unfollow(); -
game_camera()
-
Returns the game camera.
Check out the third party documentation for a more in depth explanation.Code Equivalent:
game.camera