game-object-components

Resolve Phaser 4 Game Object component mixin rendering and transform behaviors.

1|Updated May 3, 2026
One-click install
npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill game-object-components-wandertheweeb
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: game-object-components
Source: https://github.com/WanderTheWeeb/papas_trauma/tree/main/skills/game-object-components
Command: npx skills add https://github.com/WanderTheWeeb/papas_trauma --skill game-object-components-wandertheweeb

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you quickly understand how Phaser 4 Game Object component mixins work so you can set rendering, transforms, masking, bounds, and lighting behaviors correctly without trial-and-error.

Core Features & Use Cases

  • Component mixin behavior: Learn how Phaser copies component methods into GameObject classes via Mixins, so you know which APIs exist and how they behave.
  • Transform, visibility, and rendering controls: Use Alpha, Depth, Flip, Origin, Tint, Transform, and Visible to achieve predictable on-screen results (including important gotchas like alpha=0 stopping rendering).
  • Spatial queries and advanced rendering: Use GetBounds plus RenderNodes/RenderSteps/Filters guidance for WebGL-only effects and post-processing workflows.
  • Practical use cases: Ideal for implementing HUD elements (scrollFactor=0), per-corner transparency (WebGL Alpha), texture cropping, z-order fixes (setDepth vs display list order), and lighting/masking setups.

Quick Start

Ask the AI to summarize the differences between setAlpha (including per-corner alpha), setTint modes, and Transform/Origin coordinate behavior for a Sprite in Phaser 4, then provide a short checklist of what to call for a “render-only HUD” element.

Frequently Asked Questions about game-object-components

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

FAQPage Schema
How do Phaser 4 Game Object component mixins control rendering and transforms?

Phaser 4 uses component mixins to copy specific rendering, transform, and visual effect methods directly into GameObject classes. This means APIs for Alpha, Depth, Flip, Origin, Tint, and Transform are mixed in per class, determining exactly how Sprite, Image, Text, or Container instances render on screen.

Why does setting alpha to 0 stop my Phaser 4 Game Object from rendering?

Setting alpha to 0 acts as a render flag gotcha in Phaser 4 that completely stops the rendering pipeline for that Game Object. Similarly, setting scale to 0 halts rendering, meaning these components control visibility at the pipeline level rather than just making the object transparent visually.

Can I use WebGL filters and lighting effects on all Phaser 4 Game Objects?

WebGL-only filters and lighting effects apply specifically to Phaser 4 Game Objects using the WebGL render pipeline. RenderNodes and RenderSteps guide these advanced rendering workflows, meaning effects like per-corner transparency via WebGL Alpha are restricted to WebGL contexts and unavailable in Canvas rendering.

What's the best way to fix z-order and depth issues for Phaser 4 Sprites?

To fix z-order and depth issues in Phaser 4, use the Depth component's setDepth method versus relying on display list order. The Depth mixin controls the rendering hierarchy, allowing you to explicitly define which Sprites, Images, or Text objects render above others.

How do I create a render-only HUD element that ignores camera scrolling in Phaser 4?

To create a render-only HUD element in Phaser 4, set the Game Object's scrollFactor to 0 using the Transform component. This locks the HUD element's position relative to the camera viewport, preventing it from scrolling with the game world while maintaining standard rendering behavior.

Does Phaser 4 support per-corner transparency and texture cropping for Sprites?

Phaser 4 supports per-corner transparency via the WebGL Alpha component and texture cropping through component mixin APIs. These features rely on mapping the correct component methods to the appropriate Game Object types, with per-corner alpha specifically requiring the WebGL render pipeline.