game-object-components

Featured

Use this skill when working with Phaser 4 game object components and the mixin system. Covers Transform, Alpha, Tint, Origin, Depth, Flip, Mask, GetBounds, Lighting, and other shared component behaviors. Triggers on: component, mixin, transform, mask, bounds, lighting.

Web & Frontend 957 stars 79 forks Updated today MIT

Install

View on GitHub

Quality Score: 93/100

Stars 20%
99
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Phaser 4 -- Game Object Components Reference > Component mixins that provide shared behavior to all Game Objects: Alpha, BlendMode, Depth, Flip, GetBounds, Lighting, Mask, Origin, ScrollFactor, Size, Texture, TextureCrop, Tint, Transform, Visible, PathFollower, RenderNodes, RenderSteps, Filters, FilterList. ## Quick Start ```js // Every Game Object gets its component methods via mixins. // Just call them directly on any game object: const sprite = this.add.sprite(400, 300, 'hero'); sprite.setAlpha(0.5); // Alpha sprite.setBlendMode(Phaser.BlendModes.ADD); // BlendMode sprite.setDepth(10); // Depth sprite.setFlip(true, false); // Flip sprite.setOrigin(0, 0); // Origin sprite.setScrollFactor(0); // ScrollFactor (HUD) sprite.setDisplaySize(64, 64); // Size sprite.setTexture('hero', 'walk-1'); // Texture sprite.setTint(0xff0000); // Tint sprite.setPosition(100, 200); // Transform sprite.setVisible(false); // Visible sprite.setScale(2); // Transform sprite.setAngle(45); // Transform // Per-corner alpha (WebGL only) sprite.setAlpha(1, 0.5, 0.5, 1); // Crop a texture region sprite.setCrop(0, 0, 32, 32); // Enable WebGL filters (post-processing) sprite.enableFilters(); sprite.filters.internal.addBlur(1, 2, 2, 1); // Lighting ...

Details

Author
autonomous-ai
Repository
autonomous-ai/openharness
Created
1 months ago
Last Updated
today
Language
C
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category