graphics-and-shapes

Draws and manages geometric shapes in Phaser 4 using Graphics and Shape objects.

Updated Jun 21, 2021
One-click install
npx skills add https://github.com/mahirocoko/mahirocoko --skill graphics-and-shapes-mahirocoko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphics-and-shapes
Source: https://github.com/mahirocoko/mahirocoko/tree/main/plugins/phaser/skills/graphics-and-shapes
Command: npx skills add https://github.com/mahirocoko/mahirocoko --skill graphics-and-shapes-mahirocoko

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Draws and manages geometric shapes in Phaser 4 using the Graphics and Shape objects, simplifying runtime shape rendering without textures.

Core Features & Use Cases

  • Graphics game object supports dynamic drawing of rectangles, circles, lines, and gradients; Shape objects provide individual, tweenable shapes with built-in fill and stroke styles; generateTexture lets you bake drawings into reusable textures for performance.
  • Use cases include UI indicators, debugging overlays, procedurally generated art, and lightweight visual assets for dashboards and tutorials.

Quick Start

Create a graphics surface and draw shapes like a filled rectangle and a stroked circle.

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 dynamic geometric shapes in Phaser 4 without pre-loaded textures?

You can draw dynamic geometric shapes in Phaser 4 by using the Graphics and Shape objects to render rectangles, circles, and lines at runtime without requiring pre-loaded texture assets.

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

Graphics objects support dynamic batch drawing of multiple paths and gradients, while Shape objects are individual, tweenable game objects with built-in fill and stroke styles for independent manipulation.

How do I generate reusable textures from Phaser 4 graphics for better performance?

You can generate reusable textures from Phaser 4 graphics by using the generateTexture function, which bakes your drawn shapes, gradients, and paths into static textures to improve rendering performance.

Can I apply gradients and custom stroke styles to shape objects in Phaser 4?

Yes, Phaser 4 graphics and shape objects provide style primitives including fillStyle, lineStyle, and gradient support, allowing you to apply custom gradient fills and stroke styles to your rendered geometry.

What are common use cases for runtime shape rendering in Phaser game development?

Runtime shape rendering in Phaser is commonly used for creating UI indicators, debugging overlays, procedurally generated art, and lightweight visual assets for tutorials and dashboards.

Does this approach to drawing shapes work for UI components and debugging overlays?

Yes, drawing shapes with Phaser 4 Graphics and Shape objects is ideal for UI components and debugging overlays, providing lightweight, texture-free visual indicators that can be dynamically updated or tweened.