render-textures

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

2|10|Updated Jul 28, 2026
One-click install
npx skills add https://github.com/kodingvibes/gamejam-2026 --skill render-textures-kodingvibes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: render-textures
Source: https://github.com/kodingvibes/gamejam-2026/tree/main/participantes/jpyunism/.agents/skills/render-textures
Command: npx skills add https://github.com/kodingvibes/gamejam-2026 --skill render-textures-kodingvibes

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 use RenderTexture, DynamicTexture, and Stamp correctly without trial and error. ## Core Features & Use Cases - Off-screen rendering: Draw game objects, groups, containers, and texture keys to RenderTexture or DynamicTexture surfaces with draw(), stamp(), capture(), fill(), erase(), and repeat(). - Texture generation and sharing: Create procedural textures registered in the Texture Manager via saveTexture() or addDynamicTexture() so any game object can use them. - Snapshots and pixel capture: Capture full textures, regions, or single pixels with snapshot(), snapshotArea(), and snapshotPixel(). - Use Case: Build a fixed-position minimap by creating a RenderTexture with setScrollFactor(0), renderMode 'all', and preserve(true), then capturing scaled-down world objects each frame. ## Quick Start Show me how to draw a sprite and a tiled background onto a RenderTexture in Phaser 4 and use it as a texture for another image.

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) or rt.draw('textureKey', x, y), then call rt.render() to flush the command buffer. Nothing appears until render() executes the buffered commands.

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 but not visible on its own.

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

In Phaser 4, drawing methods push commands into a buffer and do not execute immediately. You must call render() to flush the buffer, unless the RenderTexture uses renderMode 'all' or 'redraw' which renders 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. Any image or sprite can then use that key, and updates to the RenderTexture reflect automatically on all objects using it.

Are RenderTexture snapshots expensive in Phaser?▼

Yes, snapshots use readPixels in WebGL which blocks the GPU pipeline, so avoid per-frame snapshots. snapshotPixel is cheaper than full snapshot, and snapshotArea lets you capture only a specific region.