Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Camera
Phaser 4.1.0
Phaser 4 examples
Camera
68
examples
Examples
68
16 Camera Grid
Demonstrates how to create and position multiple cameras in a grid layout to display the same scene across several viewports simultaneously.
Add Camera On Click
Demonstrates how to dynamically add multiple cameras to a scene on a pointer event, creating a grid of viewports that all render the same scene objects.
Camera Alpha
This example demonstrates how to adjust the transparency of a camera using its alpha property, affecting the visibility of all game objects rendered by that camera.
Camera Background Color
Learn how to set a specific background color and alpha for an individual camera using RGBA values.
Camera Background Color Interpolation
Learn how to smoothly transition the camera's background color between two values based on a sprite's vertical position using color interpolation.
Camera Blur Shader
Demonstrates how to apply a built-in blur filter to a specific camera and use camera ignore lists to keep certain game objects sharp.
Camera Bounds with Negative Coordinates
This example demonstrates how to set camera and physics world bounds using negative coordinates, allowing the camera to scroll into areas behind the (0,0) origin while following a player.
Camera Center On
Use the centerOn method to snap the camera focus to specific world coordinates, demonstrated with a zoomed-in view of a large map.
Camera Effect Callbacks
Demonstrates how to sequence multiple camera effects like flash, shake, and fade by using completion callbacks to trigger the next effect in a chain.
Camera Effects
Demonstrates the built-in camera special effects including fading, flashing, and shaking using multiple cameras and viewports.
Camera External Filter Scanline
Demonstrates applying an external shader filter to a camera and updating the shader's uniform values based on mouse input.
Camera External Filters
Demonstrates applying, toggling, and combining multiple external post-processing shaders on a camera using filter controllers.
Camera External Shader Filter
Demonstrates how to apply a custom post-processing shader effect to a camera using the external filters API and render nodes.
Camera Fade Effect
Demonstrates how to trigger a camera fade-out effect with custom colors and durations, while using event listeners to detect when the fade starts and completes.
Camera Fade In and Out
Demonstrates how to use camera fade effects to transition a scene in and out, using the fade completion event to chain effects.
Camera Fade Out and In
Demonstrates how to chain camera fade effects using the camera fade completion event to transition between different scenes or images.
Camera Filter
Demonstrates how to use the cameraFilter property to control which Game Objects are rendered by specific cameras, allowing for independent UI layers and isolated camera effects.
Camera Filter Shader
Demonstrates applying a custom post-processing shader filter to a camera view, affecting all rendered content including background images and fixed UI elements.
Camera Filters and Layer Isolation
Demonstrates how to apply external post-processing filters to specific cameras and use the ignore method to isolate which game objects are rendered by each camera.
Camera Flash Effect
Trigger a camera flash effect on user input and use event listeners to respond when the flash effect begins and finishes.
Camera Follow Offset
Demonstrates how to use followOffset to adjust the camera position relative to its target, shifting the view as the player moves left or right.
Camera Follow Sprite
Demonstrates how to have the main camera follow a user-controlled physics sprite while constrained within specific world bounds.
Camera Follow with Graphics Landscape
Create a procedurally generated landscape using the Graphics API and configure the camera to follow a Matter physics-enabled sprite across a wide world.
Camera Follow with Lerp
This example demonstrates how to have multiple cameras follow a single sprite simultaneously, using different lerp (interpolation) values to achieve varying levels of smooth movement and tracking delays.
Camera Follow with Zoom
Demonstrates the camera following a moving sprite with a high zoom level applied, constrained within specified world bounds.
Camera Follow with Zoom and Tilemap
Demonstrates a camera following a moving sprite across a tilemap while maintaining a zoom level and staying within defined map boundaries.
Camera Following with Small Bounds
Demonstrates a camera following a sprite within defined world bounds that are smaller than the game viewport in one dimension, combined with a 2x zoom level.
Camera Hue Rotate Shader
This example demonstrates how to apply a post-processing hue rotation shader to the main camera, which affects the visual appearance of the entire game scene.
Camera Ignore
Demonstrates how to exclude specific Game Objects from being rendered by a camera using the ignore method, useful for creating UI layers that remain static while the main camera moves or rotates.
Camera Ignore Container
Demonstrates how to use multiple cameras to render different game objects by using the ignore method, specifically excluding a Container and its children from the main camera to create a stable UI overlay.
Camera Ignore Containers
Demonstrates how to use the Camera ignore method to selectively hide entire Containers and all their children from being rendered by specific cameras.
Camera Ignore Game Objects
Demonstrates how to use the Camera ignore method to prevent specific Game Objects from rendering in a particular camera view.
Camera Ignore Group Children
Learn how to exclude specific Game Objects or entire Group contents from being rendered by a Camera to create isolated UI layers.
Camera Overlap
Demonstrates creating a secondary camera that overlaps the main view to display a specific, independently scrolling area of the scene.
Camera Pan to Location
Demonstrates how to use the camera pan effect to smoothly move the viewport to specific coordinates using different durations and easing functions.
Camera Plasma Shader Filter
Apply a dynamic plasma shader effect to the main camera view while using smoothed keyboard controls to navigate.
Camera Post-Processing Shader Effect
Demonstrates applying a full-screen post-processing shader filter to a camera, creating a visual wave distortion effect over the entire game scene.
Camera Post-Processing Shader Filter
Demonstrates applying a custom shader filter to the entire camera view. The post-processing effect is applied to all rendered objects, including background elements and sprites with fixed scroll factors.
Camera Shader Filter
Apply an external shader filter to a camera to process its entire rendered output, featuring a hue rotation effect and smooth camera controls.
Camera Shake Effect
Learn how to apply a screen shake effect to the main camera and use the camera shake start and complete events to trigger logic.
Camera Smoothed Key Control
Use the SmoothedKeyControl class to pan and zoom the camera using keyboard inputs, featuring smooth acceleration and deceleration.
Camera Viewport
Demonstrates how to define the position and size of the camera's rendering area within the game canvas using the setViewport method.
Camera Viewport Basics
Learn how to add a secondary camera and manipulate its basic properties including viewport size, scroll position, zoom, rotation, and background color.
Camera World Points and Hit Testing
Demonstrates using getWorldPoint to convert screen coordinates into world coordinates for accurate hit detection on geometry and interactive sprites, even when the camera is zoomed, rotated, or panned.
Camera World View Properties
Demonstrates how the camera's worldView rectangle tracks the visible area of the game world as you scroll and zoom using keyboard controls.
Camera Zoom To and Pan
Demonstrates how to smoothly transition the camera zoom level and position simultaneously over a set duration.
Cameras from Scene Configuration
This example demonstrates how to define multiple cameras directly within a Scene configuration object, including their dimensions, screen positions, and background colors.
Cross Scene Object Placement
Calculate screen-space positions for UI elements in an overlay scene based on world-space coordinates in a background scene, factoring in camera panning and zoom levels.
Fixed to Camera via Scroll Factor
Demonstrates how to keep a sprite stationary on the screen while the camera moves by using the setScrollFactor method.
Follow Sprite with Deadzone
Demonstrates how to use a camera deadzone so that the camera only begins scrolling once the followed sprite moves outside of a defined central area.
Game Camera Shader Filter
This example demonstrates how to apply a custom post-processing shader effect to the main camera view within a physics-based platformer scene.
Get World Point
Convert screen coordinates into world coordinates using the camera, accounting for zoom and scroll positions.
Grid of 16 Cameras with Shaders
Demonstrates creating a 4x4 grid of 16 cameras, where each individual camera applies a different post-processing shader filter to the same scene.
Minimap Camera
Learn how to create a persistent minimap using a second camera. This example demonstrates camera positioning, zooming, and using the ignore method to hide specific game objects from the minimap view.
Multi-Scene Camera Management
Learn how to manipulate the cameras of multiple active scenes simultaneously. A central controller scene uses tweens to move, zoom, and swap the viewports of four distinct scenes, creating dynamic layouts and transitions.
Multiple Camera Scroll Views
Demonstrates using multiple cameras to view different parts of a scene simultaneously with independent horizontal, vertical, and circular scrolling offsets.
Multiple Camera Viewports
Demonstrates creating and manipulating multiple cameras, each with its own viewport, zoom level, rotation, and scroll position to view the same scene.
Multiple Cameras
Learn how to divide the game canvas into multiple viewports by adding and positioning several cameras within a single scene.
Multiple Cameras Grid
Demonstrates how to create and arrange 32 separate cameras in a grid layout to view the same scene content.
Remove Camera On Click
Demonstrates how to dynamically remove cameras from the Camera Manager using pointer input and add new cameras to specific screen coordinates.
Rotate Camera
Rotate and pan the camera view using keyboard input while observing scroll coordinates and camera midpoint values.
Round Pixels
Learn how to use the Camera roundPixels setting to ensure sprites are rendered on integer coordinates, preventing sub-pixel blurring even when using non-integer positions or zoom levels.
Set Camera Bounds
This example demonstrates how to restrict a camera's movement to a specific rectangular area using the setBounds method, preventing it from panning outside the defined limits of the game world.
Set Scroll Factor
Demonstrates how to use setScrollFactor to control the movement speed of Game Objects relative to camera scrolling, ideal for creating parallax effects or fixed UI elements.
Set Small Camera Bounds
Restricts camera movement to a defined area using setBounds, allowing for horizontal scrolling while limiting vertical movement.
Single Small Camera
Demonstrates how to adjust the camera viewport, zoom, and scroll position to render a scene within a smaller, specific portion of the game canvas.
Tile Map Camera Shake
Demonstrates how to apply a screen shake effect to the camera while navigating a large tilemap using fixed keyboard controls.
World Coordinates from Another Scene
Convert screen pointer coordinates into world coordinates using a camera reference from a different scene, accounting for that camera's specific zoom and scroll values.