render-textures

Draws game objects to off-screen RenderTexture and DynamicTexture surfaces in Phaser 4.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/russellmorgan/UnderConstruction --skill render-textures-russellmorgan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: render-textures
Source: https://github.com/russellmorgan/UnderConstruction/tree/main/.claude/skills/render-textures
Command: npx skills add https://github.com/russellmorgan/UnderConstruction --skill render-textures-russellmorgan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4's texture-drawing API uses a command-buffer architecture that differs significantly from Phaser 3, so developers often struggle with drawing calls that silently do nothing, choosing between RenderTexture and DynamicTexture, and handling snapshots, erasing, and tiling correctly. ## Core Features & Use Cases - RenderTexture and DynamicTexture guidance: Explains when to use a visible RenderTexture game object versus a shared DynamicTexture in the Texture Manager, including cross-scene and multi-object sharing. - Command buffer and render modes: Covers the required render() flush, preserve(true) replay, and the 'render', 'redraw', and 'all' render modes. - Drawing operations: Documents draw(), stamp(), capture(), fill(), clear(), erase(), repeat(), and snapshot methods with working code patterns. - Use Case: Build a procedurally generated starfield texture shared by many sprites, a live minimap that captures scaled-down world objects each frame, or a paint-canvas effect that erases holes in a filled surface. ## Quick Start Ask the AI to show how to draw sprites onto a Phaser 4 RenderTexture and register it as a reusable texture key.

Frequently Asked Questions about render-textures

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

FAQPage Schema
How do I draw sprites to a RenderTexture in Phaser 4?▼

Create one with this.add.renderTexture(x, y, w, h), call rt.draw(sprite, x, y) or rt.draw('textureKey', x, y), then call rt.render() to flush the command buffer. Without render(), nothing appears because drawing calls are buffered.

What is the difference between RenderTexture and DynamicTexture in Phaser 4?▼

RenderTexture is a visible Image game object with its own auto-created DynamicTexture, created via this.add.renderTexture(). DynamicTexture lives in the Texture Manager via this.textures.addDynamicTexture(key), is shared by key across objects and scenes, but is not visible on its own.

Why is my RenderTexture blank after calling draw in Phaser 4?▼

Phaser 4 buffers drawing commands instead of executing them immediately, so you must call render() to flush the buffer. Alternatively set renderMode to 'all' or 'redraw' for automatic per-frame rendering.

Can I take a screenshot or snapshot of a RenderTexture?▼

Yes, use rt.snapshot(callback) for the full texture, rt.snapshotArea(x, y, w, h, callback) for a region, or rt.snapshotPixel(x, y, callback) for a single color. Snapshots use readPixels and block the GPU pipeline, so avoid calling them every frame.

Does stamp() respect the RenderTexture camera in Phaser 4?▼

No, stamp() ignores the internal camera and positions textures absolutely. Only game objects drawn via draw() or capture() respect the .camera property's scroll, zoom, and rotation.