Gaugeworks: Health, Shield, Mana and Stamina Bar Kit
README.md
Showcase
The barsKit gallery. Put it on any entity and every look appears side by side, all following one value that drains and refills. Each card is labelled with the look's name, families, shape, placement and size, and the cards are dealt into even rows. It also has family filter chips, resource-colour chips and a numbers toggle.
A switcher flips your own health bar through every look with [ / ] or ◀ ▶. That bar is the Bar on the playerBar entity, or else your first health screen bar.
The gallery stays out of the HUD's way at any screen size:
- The panel takes the largest rect the HUD leaves free (
BK.freeRect), and bars under it are hidden until it closes. - The switcher sits inside the gallery while it is open, and stands alone when it is closed.
On a desktop-sized window every card and its label fits on screen at once, with no scrolling: the column count and card size are picked to fit the panel (BK.layout.fitGrid). A panel too small for that, such as a phone in either orientation, scrolls. gridInfo() returns the grid it drew last, and layoutFor(W, H, rect?) lays it out for another screen size without drawing.
G or the open field toggles it. Removing the component or despawning its entity takes down both of its screens. Bar components are needed in the scene only for the switcher.