Powerplay: Abilities, Cooldowns and Status Effects Kit
README.md
hud
The UI side of abilitiesKit: ability bars and status icons in many layouts and five styles, plus the world-wide setting that "auto" components follow.
local Hud = require("abilitiesKit.hud")
Hud.renderBar("moba", "fantasy", AK.barView(), { scale = 1 }) -- a widget node; style.width/height = its size
Hud.renderEffects("buffBar", "pixel", AK.effectsView(), {})
Hud.setDefaults({ layout = "radial", style = "cartoon", statusLook = "chips" })
- Renderers:
renderBar(layout, style, view, opts)andrenderEffects(look, style, effects, opts)are pure functions of the view. Pass"auto"to use the world default.measure(node)returns a node's size. - Catalogue:
layouts()(hotbar, moba, radial, pips, orbs, touch),styles()(scifi, fantasy, cartoon, pixel, minimal) andstatusLooks()(overhead, buffBar, list, chips) each return{ id, label, description }. - Defaults:
defaults()andsetDefaults({ layout, style, statusLook, overheadLook }).AK.setUiStyle,AK.setBarLayoutandAK.setStatusLookcallsetDefaults. - Live data:
api(),localCharacter(),resolveTarget(target, fallback),barView(id),effectsView(id),isHidden(id)andcast(id, slot)wrap abilitiesKit.api and return nil while it is missing. - Placement:
screenScale(W, H),safeArea(),touchRects()(controlsKit's on-screen buttons) andplace(anchor, w, h, W, H, margin, avoid). - Drivers:
barScreen(pub, W, H)builds an AbilityBar's full-screen tree, which the component registers itself so that its touch clicks reach it. StatusIcons components register withaddStatusandremoveStatusand share the screenabilitieskit_status(statusFrame,buildStatus). - Parts:
Hud.Bar(uiBar),Hud.Status(uiStatus),Hud.Themes(uiThemes),Hud.Sample(uiSample) andHud.Icons.
Touch buttons fire Hud.CAST_PREFIX .. slot ("abilitiesKit.cast:3"). castSlotFromCallback parses that callback id.