render-textures

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

465|41|Updated Aug 4, 2026
One-click install
npx skills add https://github.com/autonomous-ai/openharness --skill render-textures-autonomous-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: render-textures
Source: https://github.com/autonomous-ai/openharness/tree/main/store/agents/phaser/skills/render-textures
Command: npx skills add https://github.com/autonomous-ai/openharness --skill render-textures-autonomous-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Phaser 4's texture-drawing API uses a command-buffer architecture that differs from earlier versions, so developers often struggle with drawings not appearing, 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() mode, and the 'render', 'redraw', and 'all' render modes for automatic per-frame updates. - Practical patterns: Provides working code for stamping with transforms, capture with property overrides, erasing, tiling with repeat(), pixel snapshots, procedural texture generation, and minimap implementations. - Use Case: Build a live minimap by creating a RenderTexture with setScrollFactor(0), render mode 'all', and preserve(true), then capturing scaled-down world objects each frame. ## Quick Start Ask the AI to create a Phaser 4 RenderTexture that draws a sprite and a tiled background, then registers it as a shared texture for other game objects.

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, is shared across scenes and objects by key, and must be assigned to a game object to be visible.

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

Phaser 4 buffers draw, fill, and stamp calls into a command buffer instead of executing immediately. You must call render() to flush it, or set the render mode to 'redraw' or 'all' for automatic per-frame rendering.

How do I take a screenshot or snapshot of a Phaser texture?

Use rt.snapshot(callback) for the full texture, snapshotArea for a region, or snapshotPixel for a single pixel's Color. Snapshots use readPixels and block the GPU pipeline, so avoid calling them every frame.

Can multiple game objects share one generated texture in Phaser?

Yes. Create a DynamicTexture with this.textures.addDynamicTexture(key, w, h), draw into it, and any game object can reference it by key. Alternatively, call rt.saveTexture(key) on a RenderTexture to register it in the Texture Manager.

Why does stamp() ignore camera scroll on a RenderTexture?

The stamp() method positions texture frames absolutely and bypasses the internal camera. Only game objects drawn via draw() or capture() respect the texture's .camera scroll, zoom, and rotation settings.