Phaser home
Phaser AE
Open source
Phaser 4
Download
Learn
Editor
Tools
Docs
Examples
News
Log in
Examples
/
Game Objects
/
Graphics
Phaser 4.1.0
Phaser 4 examples
Graphics
57
examples
1
folder
Folders
1
Primitives
17 examples
Examples
40
3D Wireframe OBJ Viewer
Demonstrates how to parse 3D .obj files and render them as animated wireframe objects using Phaser Graphics and manual vertex rotation math.
3D Wireframe Teapot
Demonstrates parsing a 3D .obj model and rendering it as a rotating wireframe using Graphics primitives with manual vertex rotation and back-face culling.
Arc Stroke
Demonstrates how to draw and stroke circular arcs using Graphics, including setting line widths, colors, and arc directions.
Atari Graphics Lines
Demonstrates drawing complex vector shapes and stylized outlines using Graphics path commands like beginPath, moveTo, lineTo, and strokePath.
Circle Overlap
Learn how to create and animate multiple Graphics objects containing concentric circles to produce a dynamic overlapping visual effect.
Drawing Filled Shapes with Graphics
Demonstrates how to use the Graphics object to draw solid and semi-transparent rectangles and triangles.
Drawing Star Shapes
Demonstrates how to use the Graphics object to procedurally draw star shapes by calculating vertex positions based on points, radii, and line styles.
Fill Rounded Rectangle
Demonstrates how to draw filled rounded rectangles using the Graphics object, featuring both uniform corner radii and custom radius values for individual corners.
Filled Rectangles
Demonstrates how to use the Graphics object to draw multiple overlapping filled rectangles with varying transparency levels.
Generate Texture for Blitter
Demonstrates creating a custom shape with a Graphics object, converting it into a reusable texture, and then using that texture to render high-performance bobs within a Blitter object.
Generate Texture from Graphics
Demonstrates how to convert a Graphics object into a reusable texture that can be applied to Images or Sprites.
Generate Texture from Graphics
Demonstrates how to draw shapes using a Graphics object and convert them into a reusable texture that can be applied to an Image Game Object.
Generate Texture to TileSprite
Demonstrates how to draw shapes with Graphics, convert them into a reusable texture key, and apply that texture to a scrolling TileSprite.
Graphics Arc
Demonstrates how to draw a curved arc using the Graphics object, specifying the center position, radius, start and end angles, and direction.
Graphics Arc Chomp Animation
Create an animated chomping effect by dynamically updating the angles of a Graphics slice using a Tween counter.
Graphics Canvas Transformations
Demonstrates using translate, scale, and rotate transformations within a Graphics object to draw and animate multiple shapes using a canvas-style state stack.
Graphics in a Container
Demonstrates how to add a Graphics object to a Container and draw shapes using coordinates relative to the container's position.
Graphics Line Styles
Learn how to configure stroke properties including thickness, color, and alpha when drawing shapes using the Graphics object.
Graphics Line Tracing
Interactively draw and commit persistent lines to the screen using pointer events, geometry shapes, and the Graphics object.
Graphics Rendering and Transformations
Draw a complex star shape using Graphics path commands and apply real-time rotation and scaling transformations.
Graphics Transformation Logo
Demonstrates creating an animated, multi-layered vector logo using Graphics path drawing combined with canvas-style translation, rotation, and scaling.
Health Bars using Graphics
Create dynamic, reusable health bars for game objects by drawing and updating rectangles with the Graphics object.
Line Rendering with Graphics
Demonstrates how to use the Graphics object to draw geometric shapes and custom paths with specific line and fill styles, while applying real-time rotation and scaling.
Line Thickness
Learn how to define the width and color of strokes when drawing rectangles, circles, and custom paths using the Graphics object.
Many Stars
Demonstrates rendering and animating a large number of individual Graphics objects, featuring procedurally drawn stars with updating rotation and scale.
Motion Trail with Graphics
Create a colorful motion trail effect by storing a history of coordinates and drawing them sequentially using a Graphics object and an HSV color wheel.
Mouse Trail with Graphics
Create a dynamic, multi-colored mouse trail using a Graphics object by drawing a continuous path through a history of pointer positions with varying line thickness and color.
Multiple Cameras and Effects
Create multiple camera viewports within a single Scene to display the same game objects with different simultaneous effects including shake, flash, fade, zoom, and rotation.
Multiple Graphics Instances
Create and update hundreds of individual Graphics objects, each with unique positions, rotations, and scales.
Pacman Arc
Demonstrates how to use the Graphics.slice method to draw a partial circle, creating a filled Pacman-style shape.
Phaser Logo Shift
Demonstrates complex Graphics transformations, color cycling, and manual vector drawing to create an animated, multi-layered logo effect.
Primitive Graphics Shapes
Demonstrates how to draw basic shapes using the Graphics object, including rectangles, circles, and ellipses with custom fill and line styles.
Pseudo-3D Graphics Logo
Demonstrates a pseudo-3D stacking effect by rendering multiple layers of a vector-drawn logo using Graphics transformations, coordinate offsets, and HSV color cycling.
Rendering Thousands of Circles with Graphics
Demonstrates how to efficiently draw and animate 2,000 individual circles using a single Graphics object within the update loop.
Spinning 3D Wireframe Cube
Demonstrates rendering a rotating 3D wireframe cube by manually calculating vertex rotations and drawing the edges using the Graphics object.
Stroke Circle
Demonstrates how to draw a circle outline using Graphics lineStyle and the strokeCircle method.
Stroke Path
Learn how to draw custom vector shapes by defining a path of points and applying a line style to outline it using a Graphics object.
Stroke Rect
Demonstrates how to draw the outline of a rectangle using the Graphics object, including setting the line thickness, color, and alpha.
Stroke Rounded Rectangle
Demonstrates how to draw the outline of rounded rectangles with both uniform corner radii and individual radii for each corner using the Graphics object.
Stroke Triangle
This example shows how to use a Graphics object to draw the outline of a triangle by defining three coordinate points and a custom line style.