render-textures

Draw game objects to off-screen textures using Phaser 4 RenderTexture and DynamicTexture.

Updated Jun 10, 2026
One-click install
npx skills add https://github.com/mudman1986/quarterless --skill render-textures-mudman1986
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: render-textures
Source: https://github.com/mudman1986/quarterless/tree/main/.github/skills/render-textures
Command: npx skills add https://github.com/mudman1986/quarterless --skill render-textures-mudman1986

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4's command-buffer rendering model makes off-screen texture drawing non-obvious: drawing calls do nothing until render() is called, and choosing between RenderTexture, DynamicTexture, and Stamp requires understanding their distinct roles. This Skill provides the patterns and API reference needed to composite sprites, generate procedural textures, build minimaps, and capture snapshots 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 saveTexture patterns. - Command buffer and render modes: Covers render(), preserve(), renderMode ('render', 'redraw', 'all'), callbacks, and the internal camera so drawing actually appears as expected. - Practical patterns: Includes code for stamping with transforms, erasing, tiling with repeat(), capture() with property overrides, snapshots, procedural starfield generation, and a minimap implementation. - Use Case: You want a fixed-position minimap in your Phaser 4 game. Use the minimap pattern to create a RenderTexture with setScrollFactor(0), renderMode 'all', and capture() calls that draw scaled-down world objects each frame. ## Quick Start Ask the AI to show how to draw a sprite onto a Phaser 4 RenderTexture and use it as a texture for another game object.

Frequently Asked Questions about render-textures

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

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

Create one with this.add.renderTexture(x, y, width, height), call rt.draw(sprite, x, y), then call rt.render() to flush the command buffer. In Phaser 4, drawing calls are buffered and nothing appears until render() executes.

What is the difference between RenderTexture and DynamicTexture in Phaser?

RenderTexture is a visible Image game object with its own DynamicTexture, created via this.add.renderTexture(). DynamicTexture lives in the Texture Manager via this.textures.addDynamicTexture(key), is shared across objects and scenes by key, 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. You must call render() to flush the command buffer, or set renderMode to 'redraw' or 'all' so rendering happens automatically every frame.

Can I use a RenderTexture as a texture for other game objects?

Yes. Call rt.saveTexture('key') to register the RenderTexture's DynamicTexture in the Texture Manager, then use that key in this.add.image() or this.add.sprite(). Updates to the RenderTexture automatically reflect on all objects using it.

Are RenderTexture snapshots expensive in Phaser?

Yes. snapshot(), snapshotArea(), and snapshotPixel() use readPixels in WebGL, which blocks the GPU pipeline. Avoid per-frame snapshots; snapshotPixel is cheaper than a full snapshot when you only need one pixel's color.