Repository navigation
Add texture atlas skins to the virtual gamepad - #1840
Conversation
|
The test job lost its Vitest browser connection while importing I checked the controls:
This matches the browser disconnect already documented in the workflow. The failed suite import also matches its “Test Files … failed” guard, so the existing automatic retry did not run. Could you re-run the failed test job? |
The skins from #1840 are a new feature: 1.2.0, unreleased. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JnzwA4xBNBw7cEZzG1bUru
|
Thank you @snowyukitty, this is a great addition! Clean code, thorough Canvas/WebGL pixel tests (including trimmed and rotated frames), and it stays fully backward compatible: without a skin the controls draw exactly as before. Two small follow-ups landed in #1841:
It will ship with the next gamepad-plugin release. Thanks again! Generated by Claude Code |
No worries, i'll look into it, thanks for the contribution ! |
Description
Adds optional
TextureAtlasskins to the gamepad plugin. Sticks can namebaseandthumbregions, and buttons can name restingregionandpressedregions. Each omitted part keeps its existing shapes, so games can skin controls gradually.The skin uses the existing control positions, radii and hit areas. Cached sprites handle packed atlas rotation and trimming, while the controls retain their opacity, held highlight, dimming, visibility, labels and floating behavior. Invalid region names are rejected before a virtual gamepad slot is claimed; destroying the plugin releases its sprites without destroying the game's atlas.
The visual page now has a skin toggle with a small generated atlas. The README, option documentation, changelog and input skill describe the API.
Type of change
Validation
pnpm lint,pnpm biome checkandpnpm buildpass.pnpm test: 10,439 engine tests pass; 11 are skipped.The plugin also builds and passes all 93 tests with melonJS 20.12.0, its declared minimum version.
Checklist
pnpm lintpasses)pnpm testpasses)pnpm build)Related issues
Fixes #1802