render-textures

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Drawing sprites, groups, and textures to off-screen surfaces in Phaser 4 requires understanding the command-buffer architecture, where draw calls do nothing until render() is called. This Skill provides the patterns and API reference needed to composite textures, generate procedural images, build minimaps, and capture snapshots without trial-and-error. ## 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 render(), preserve(), and the 'render'/'redraw'/'all' render modes so drawing actually appears on screen. - Complete drawing API: Documents draw, stamp, capture, fill, clear, erase, repeat, snapshot, resize, and saveTexture with working code examples and gotchas. - Use Case: Build a live minimap by creating a RenderTexture with setScrollFactor(0) and render mode 'all', then capturing scaled-down world objects each frame. ## Quick Start Ask the AI to create a Phaser 4 RenderTexture that draws a sprite to an off-screen texture and reuses it as a texture key 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 a RenderTexture with this.add.renderTexture(x, y, w, h), 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 them.

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 is a texture in the Texture Manager created via this.textures.addDynamicTexture(key, w, h), shareable across scenes and game objects but not visible on its own.

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

Phaser 4 buffers draw commands instead of executing them immediately, so you must call render() to flush the buffer. Alternatively, set the render mode to 'all' or 'redraw' with setRenderMode() to render 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 the key.

Are RenderTexture snapshots slow in Phaser?

Yes, snapshots use readPixels in WebGL, which blocks the GPU pipeline and is expensive. Avoid per-frame snapshots; snapshotPixel is cheaper than full snapshot, and snapshotArea limits the read region.