Rexui Shapes And States
Designrexui-shapes-and-statesRexui Shapes And States is an Agent Skill for design published in the rexrainbow/phaser3-rex-notes repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Use this skill when building RexUI visual skins, shape backgrounds, roundRectangle, ninePatch, ninePatch2, QuadShape, triangle, customShapes, imageBox, lazyLoadImageBox, circleMaskImage, alphaMaskImage, statesImage, statesText, statesBitmapText, statesRoundRectangle, statesNinePatch, statesNineSlice, statesBarRectangle, circularProgress, lineProgress, roundRectangleProgress, customProgress, aioSpinner, canvas, chart, cover, fullWindowRectangle, or fullWindowZone. Triggers on: RexUI skin, RexUI state, RexUI shape, statesImage, statesRoundRectangle, roundRectangle, ninePatch, progress, imageBox.
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/rexrainbow/phaser3-rex-notes/blob/HEAD/skills/rexui/rexui-shapes-and-states/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/rexui-shapes-and-states, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
RexUI Shapes And States
Use this skill for RexUI visual building blocks: backgrounds, scalable image skins, state-aware button skins, image containers, progress displays, and canvas/chart wrappers.
Use This First
Choose the visual component:
| Need | Use |
|---|---|
| Common rounded background for labels/dialogs/panels | roundRectangle |
| Canvas-backed rounded background | roundRectangleCanvas |
| Scalable textured background | ninePatch or ninePatch2 |
| Triangle toggle arrow | triangle |
| Custom vector drawing | customShapes |
| State-aware image icon | statesImage |
| State-aware text | statesText or statesBitmapText |
| State-aware rounded background | statesRoundRectangle |
| State-aware scalable textured background | statesNinePatch or statesNineSlice |
| State-aware progress/bar background | statesBarRectangle |
| Image fitted into a UI box | imageBox or lazyLoadImageBox |
| Circular or alpha-masked image | circleMaskImage or alphaMaskImage |
| Circular progress ring | circularProgress |
| Linear progress bar | lineProgress |
| Rounded rectangle progress | roundRectangleProgress; verify gotcha first |
| Custom progress drawing | customProgress |
| Loading spinner | aioSpinner |
| Canvas object or Chart.js wrapper | canvas or chart |
| Full-screen overlay/input layer | cover, fullWindowRectangle, fullWindowZone |
For layout placement, use rexui-layout-sizers. For button events that drive state changes, use rexui-basic-widgets.
Required Setup
This skill assumes RexUI is available as this.rexUI. If not, use rexui-setup-and-factory.
References
Read these only when needed:
references/shape-catalog.md: component chooser, factory signatures, source files, and factory-name gotchas.references/skin-states.md: active/hover/disable state style fields and button-state wiring.references/progress-recipes.md: progress bars, spinners, custom progress, and image wrappers.
Core Rules
- Prefer
roundRectanglefor simple generated UI skins; useninePatchwhen the visual must come from a texture. - Use state-aware objects only for visual state; drive
setActiveState(),setHoverState(), andsetDisableState()from button/list/dialog events. - Do not store selection only in the visual state object. Keep state in the owning button/list model and apply it to the skin.
- Call
.layout()after placing shape/state objects inside RexUI sizers, labels, buttons, dialogs, or panels. - Create opaque backgrounds before content when manually composing objects that share Phaser display-list depth.
- Use
value,setValue(), oreaseValueTo()for progress components; values are normalized from0to1unless mapped with min/max arguments. - Use package imports only in full setup examples; local
templates/ui/...paths are source-map paths.
Source File Map
templates/ui/roundrectangle/RoundRectangle.d.tstemplates/ui/roundrectanglecanvas/RoundRectangleCanvas.d.tstemplates/ui/ninepatch/NinePatch.d.tstemplates/ui/ninepatch2/NinePatch.d.tstemplates/ui/quadshape/QuadShape.d.tstemplates/ui/triangle/Triangle.d.tstemplates/ui/customshapes/CustomShapes.d.tstemplates/ui/canvas/Canvas.d.tstemplates/ui/imagebox/ImageBox.d.tstemplates/ui/lazyloadimagebox/LazyLoadImageBox.d.tstemplates/ui/circlemaskimage/CircleMaskImage.d.tstemplates/ui/alphamaskimage/AlphaMaskImage.d.tstemplates/ui/statesimage/StatesImage.d.tstemplates/ui/statestext/StatesText.d.tstemplates/ui/statesbitmaptext/StatesBitmapText.d.tstemplates/ui/statesroundrectangle/StatesRoundRectangle.d.tstemplates/ui/statesninepatch/StatesNinePatch.d.tstemplates/ui/statesnineslice/StatesNineSlice.d.tstemplates/ui/statesbarrectangle/StatesBarRectangle.d.tstemplates/ui/circularprogress/CircularProgress.d.tstemplates/ui/circularprogresscanvas/CircularProgressCanvas.d.tstemplates/ui/lineprogress/LineProgress.d.tstemplates/ui/lineprogresscanvas/LineProgressCanvas.d.tstemplates/ui/roundrectangleprogress/RoundRectangleProgress.d.tstemplates/ui/customprogress/CustomProgress.d.tstemplates/ui/aiospinner/AIOSpinner.d.tstemplates/ui/chart/Chart.d.tstemplates/ui/cover/Cover.d.tstemplates/ui/fullwindowrectangle/FullWindowRectangle.d.tstemplates/ui/fullwindowzone/FullWindowZone.d.ts
Related Skills
rexui-setup-and-factory: plugin setup and factory discovery.rexui-components-catalog: choose the correct component family.rexui-layout-sizers: place visual objects in layouts.rexui-basic-widgets: buttons, labels, tabs, and value controls.rexui-scroll-lists-and-tables: state skins inside reusable cells.rexui-interactions-and-effects: hover/click/gesture effects that drive visual states.