graphics-and-shapes

Guide Phaser 4 primitive rendering with Graphics and Shape game objects.

Updated Mar 13, 2026
One-click install
npx skills add https://github.com/Dominik-Steinweg/Fragdachse --skill graphics-and-shapes-dominik-steinweg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphics-and-shapes
Source: https://github.com/Dominik-Steinweg/Fragdachse/tree/main/.agents/skills/graphics-and-shapes
Command: npx skills add https://github.com/Dominik-Steinweg/Fragdachse --skill graphics-and-shapes-dominik-steinweg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill resolves the complexity of choosing between imperative drawing surfaces and declarative shape objects in Phaser 4, ensuring optimal performance and correct implementation of visual primitives.

Core Features & Use Cases

  • Graphics Game Object: Provides an imperative drawing surface for complex paths, gradients, and dynamic command-buffer rendering.
  • Shape Game Objects: Offers a suite of pre-defined, fully-featured game objects like rectangles, circles, and polygons that support tweens, physics, and input.
  • Use Case: Use this skill to determine whether to use a Graphics object for a custom-drawn dynamic UI element or a Shape object for a physics-enabled interactive game component.

Quick Start

Use the graphics-and-shapes skill to draw a filled rectangle and a stroked circle on the current scene.

Frequently Asked Questions about graphics-and-shapes

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I draw primitive shapes in Phaser 4?

To draw primitive shapes in Phaser 4, you can use either the Graphics game object for imperative command-buffer drawing or pre-defined Shape game objects for declarative instantiation. Choose Graphics for complex paths and dynamic rendering, or Shape objects for standard primitives.

What is the difference between Graphics and Shape game objects in Phaser?

Graphics objects in Phaser provide an imperative drawing surface for complex paths and dynamic command buffers, whereas Shape objects are declarative, fully-featured game objects that support physics, tweens, and input for interactive elements.

When should I use a Graphics object instead of a Shape object for game development?

Use a Graphics object when you need an imperative drawing surface for complex paths, gradients, or dynamic command-buffer rendering. Use Shape objects for pre-defined primitives requiring physics, tweens, and input handling.

Can I use Phaser Shape objects for physics and interactive UI components?

Yes, Phaser Shape game objects are declarative, fully-featured components that natively support physics, tweens, and input, making them ideal for physics-enabled interactive game components and UI elements.

How do I choose the best rendering strategy for primitives in Phaser 4?

Select a Phaser 4 rendering strategy by evaluating performance requirements, path complexity, and interactivity needs. Use Graphics for complex dynamic paths and Shape objects when physics and input support are required.

Does Phaser 4 Graphics support gradient rendering for dynamic paths?

Yes, the Phaser 4 Graphics game object provides an imperative drawing surface that supports gradient rendering and dynamic command-buffer drawing for complex paths in game development.