Menu
Sign inDownload

Button packs

Every part of a button pack, and how your widgets use one.

Every part of a pack by the name we use for it, how each one is drawn, stretches and changes state

A button pack is a cockpit-hardware style for the whole pad. The player picks one per layout (or none, for the plain look), and every button, switch and widget on that layout is drawn in it. There are 16 packs; players see their names (Spearhead, Field Issue, Pearl, Hazard, Slate, Foundry, Skyliner, Rally, Workhorse, Bioglow, Dune, Rapier, Bazaar, Redline, Neon, Bare Metal).

This page names every part the way Comms Array does inside, so you can talk about them, design against them and, as add-on support grows, use them. It's kept up to date as packs change. What an add-on can use today (add-on API 1.3: the plate under your widget and the pack's colours) is in "Your add-on on a pack" below; every other object an add-on gets is in the Add-on objects.

Status: packs are drawn by CSS (one stylesheet per pack, the same everywhere): every button, switch and widget. Next come a table part and inline controls (tabs, toggles, small buttons), then add-ons drawing all of it by class name (add-on API 1.4). Sections marked planned describe what's coming and may still change.

The parts

The plate

Every control and every tile sits on a plate: the pack's hardware. From the outside in:

PartWhat it is
outer edgethe dark line around the plate
rimthe band between the outer edge and the face: the plate's bezel
pinlinea thin line just inside the rim, around the face. It lights up in the pack's lamp colour on a lit lamp toggle and on a pressed push button
facethe plate's surface (a gradient, top to bottom). Everything else sits on it, and your content goes on it
decorationsthe pack's own markings on the face, cut to its shape: bolts and rivets, hazard stripes, racing stripes, corner brackets, rails, pinstripes, seams, studs. Small ones at the face's sides can come off a tile when they'd cover a label

The plate's shape is the pack's: chamfered corners, pill ends, slants, teardrops, hex ends, blades.

Push button

A plate you press. Pressed: the face (and its decorations) drop one unit, the face darkens slightly and the pinline lights. A push button fills its tile: it stretches to any tile size (below).

Lamp toggle

A push button with the pack's lamp at the top of its face, lit while the game reports the thing as on. Fills its tile like a push button.

Square key

A 1:1 key (the art is 64 x 64), with a label or one of the pack's 12 icons. Showing a state, it has a lamp that lights and a pinline that lights. Square keys keep their shape: they only get bigger or smaller, never stretch.

Slide switch and vertical switch

For actions the game reports a state for. Their parts:

PartWhat it is
plateas above
trackthe slot the knob slides in; it fills with a colour from the pack's lamp when on
knobthe part that moves: at the start of the track when off, at the far end when on
gripthe three ridges on the knob, when the action has no icon
iconthe action's icon on the knob in place of the grip: lit in the lamp colour when on, dimmed when off, always upright
lampat the end of the switch, lit when on, with its glow

A slide switch is horizontal; a vertical switch is up = on. Packs draw their vertical three ways: the slide turned on its side (most; Spearhead, Redline and Foundry mirrored back so their corners face the right way), an upright plate around a turned switch (Hazard, Bare Metal), or a shape of its own (Rapier's blade).

The lamp and its glow

Each pack has its own lamp shape: a dot, an ellipse, a bar, three small lights, a parallelogram, a hexagon. Lit, it takes the pack's lamp colour and a soft glow around it; off, a dark version with a thin edge.

Widgets

Every other widget sits on the same plate as a push button, stretched to its tile, with its content kept on the face:

Widget partWhat it is
bara gauge's fill in a recessed well (the plate's rim colour); segmented (ten lit blocks) on the angular packs (Spearhead, Field Issue, Hazard, Workhorse, Redline, Bare Metal, Bazaar), smooth on the rest; upright in a tile taller than it's wide
ring diala gauge as a ring with ticks, the value inside and the name under it; it takes the biggest circle that fits the face
screena readout's dark glass, its value lit in the lamp colour (amber or red for a warning or a bad value)
lightsa value's parts or an engine's status: each one the pack's own lamp, lit in its level's colour
lightone light on its own (a cluster's light, or any value's level). An indicator, not a button: no plate, the pack's own lamp as big as the tile allows, its name under it as a caption. Dark while fine, amber for a warning, red for bad, the same in every pack; without a pack, a plain lens
rowsparts or an engine's list as rows, each with a lamp
four sidesfront, back, left and right around a mark: a bar where the side has a fill, its lamp where it doesn't
label platea heading on a plate, its text shrunk to fit

The table

Rows of the same columns, for lists: the party, an engine's list panels, a value's parts as rows (and, from add-on API 1.4, your own widgets).

Table partWhat it is
header rowthe columns' names, small and dim (only when a column has a name)
rowone line of cells; every row shares the columns, so they line up. A thin rule in the pack's edge colour under each
text celltext; too long for its column, it ends in "…"
number cellright-aligned, in even-width digits so they line up
lamp cellthe pack's own lamp, lit in the row's level (fine, warning, bad), or a dot without a pack
bar cella short bar in the pack's well, filled in the lamp colour (amber or red for a warning or bad row)
highlighted rowone row tinted in the pack's accent (in the party: you)
"+N more"the rows that don't fit the tile, folded into one last row: a table never scrolls, as no page does

Icons

12 per pack, drawn in the pack's style: power, shields, weapons, missiles, quantum, engines, landing gear, lights, doors, comms, scanner, cargo.

States

StateWhenWhat changes
pressedwhile the player's finger is on a buttonthe face, decorations and label drop one unit; the pinline lights
on (lit)the game reports the thing as onlamps light and glow; a lamp toggle's or square key's pinline lights; a switch's knob is at the far end and its track fills; the icon lights
busythe action was sent and the game hasn't confirmed yetlike on, pulsing

How things stretch

Tiles come in many sizes, in square cells (1x1 up to 32 wide, 40 tall; a button is usually 4x2, a square key 2x2). The art is drawn at one size (a button is 128 x 64 units, a square key 64 x 64, a switch 128 x 64 or 64 x 128), and fitted like this:

  • Stretching controls (push buttons, lamp toggles, every widget's plate): every point keeps its distance to its own corner. So corners, bevels, bolts and brackets stay exactly as drawn and the middle grows. A point exactly on the centre line stays on the centre. On a tile smaller than the art, the corners shrink in proportion.
  • Repeating decorations (hazard stripes, dashed seams) repeat along their edge instead of stretching.
  • Shape-keeping controls (square keys) scale evenly.
  • Switches keep their scale across (the art's 64 units fill the tile's short side, at most half its length) and grow along their length: the track lengthens, the plate's ends and the lamp stay as drawn, and the knob moves whole to its end: it never stretches.
  • Content on the face (labels, values) is kept on the face's actual shape (rounded, slanted or hex ends cut in) and clear of the side decorations. Labels wrap only between words and shrink to fit.

Your add-on on a pack

Add-on API 1.3. Set "api_version": "1.3" (or newer) and this all happens without code:

  1. Your tile sits on the plate. When the layout has a pack, the pad draws the pack's plate under your tile (stretched like any widget's, above) and puts your frame on the face: inset from the rim, on a clear background. So the rim, pinline and decorations stay the pack's, and the middle is yours. A kind that draws edge to edge (a map, a camera) says add: { plate: false } and keeps the whole tile, with no plate.
  2. The pad's colours become the pack's. In a plated frame, pad.css's variables are set to the pack's (table below). A "w b" box goes clear so the plate shows, and anything you colour with var(--text), var(--ok) and the rest follows whatever pack the player picks.
  3. **CA.pack has the colours as data**, in every frame, for what CSS doesn't reach (a canvas, an SVG you build). CA.plated says whether this tile is on the plate. Panels and plate: false tiles get CA.pack but keep the pad's own dark colours, since they aren't drawn on the face (a light pack's dark text would vanish on the dark sheet).
  4. A pack change redraws you. When the player switches packs (or to none), your frames are made again, so read CA.pack when you draw and you're always right.
Variable (on the plate)CA.pack fieldUse it for
--texttexttext on the face (dark on a light pack, light on a dark one)
--dimdimsecondary text
--okokfine: the pack's lamp colour
--warn, --badwarn, badamber and red, the same in every pack
--offoffsomething that's off
--accent, --pk-accentaccentthe pack's accent
--pk-lamplampa lit lamp
--pk-facefacethe face colour (what you're drawn on)
--pk-wellwellthe rim colour: a recess, like a gauge's bar well
--pk-edgeedgethe outer edge: thin lines and borders
namethe pack's name, for people
roundthe pack draws gauges as ring dials: draw yours round to match
segmentedthe pack's bars are ten lit blocks: draw yours segmented to match

A bar that looks like the pack's own, in your tile:

<div class="w b">
  <span>Shields</span>
  <div style="width:80%; height:8px; border-radius:4px; background:var(--pk-well, var(--off)); overflow:hidden">
    <div id="fill" style="height:100%; width:0; background:var(--pk-lamp, var(--ok))"></div>
  </div>
</div>

The fallbacks (var(--pk-lamp, var(--ok))) keep it right with no pack too. Set the fill's width from CA.value(id).pos and its colour from CA.value(id).level in your update(state).

Packs by ship

The 16 packs were drawn after Star Citizen's ship makers. A layout's pack setting has three kinds of choice:

  • None: the plain look.
  • One pack: every ship the same.
  • Match my ship: the pack follows the ship you're in.
    • Each ship is in its maker's pack. The game's engine says which: the maker's code at the start of the ship's class name (AEGS, DRAK, ORIG...), else the telemetry's maker.
    • Your picks come first: any ship can be set to any pack (an Origin ship in the Spearhead pack), remembered on the layout.
    • A fallback pack is used before you've boarded anything, and in a ship whose maker has no pack (Greycat, Tumbril).
    • On foot the pad keeps the last ship's pack, so walking around doesn't change the look. Each device remembers it per layout.
    • Never while you edit: the designer keeps the pack the page was opened in.

The pack list names the maker each pack matches ("Spearhead · Aegis Dynamics ships"). The names come from the game's engine (pack_makers), so another game can match its own makers or offer none.

For an add-on, nothing changes: CA.pack is always the pack in use, and when it changes (boarding another ship) your frames are drawn again with the new one.

Colours

Every pack has a face colour, an accent and a lamp colour; warning is amber and bad is red in every pack; "fine" is the pack's lamp colour. An add-on gets them as CA.pack (add-on API 1.3, with the full list: face, accent, lamp, ok, warn, bad, off, well, edge, text, dim) and, on a plate, as the pad's CSS variables (--text, --dim, --ok, --warn, --bad, --accent, --pk-*).

Your widget in the pack's parts (add-on API 1.4)

From 1.4 your widget can draw with the pack's own parts, by class name, and the player decides per widget whether it wears the pack.

The two looks. Each of your widgets is in one of two looks:

  • The pack's look (CA.look === "pack"): the pack's two stylesheets are loaded in your frame, the pack's colours are in --pk-face, --pk-well, --pk-edge, --pk-lamp and --pk-accent, and the classes below are drawn in the pack's hardware. On a plate (CA.plated) the pad's own colour variables are the pack's too, as in 1.3.
  • Your own look (CA.look === "own"): none of that; your frame is yours alone, off the plate. Also the look when the layout has no pack.
  • Your panels (the full-screen pages CA.openPanel opens) are always in your own look: they open on the pad's dark sheet, not on a plate. CA.pack is there as data.

You say which one a kind starts in with add: { look: "own" } (the default is "pack"). The player can switch any of your widgets in its settings ("The Spearhead pack's look" / "Hello's own look"); the pick is saved on the widget (ca_look, a reserved field name) and your frame is drawn again in it. Style your own look under body.ca-look-own (the body has ca-look-pack or ca-look-own), so the same markup serves both.

The classes. In pad.css, so they work in both looks: plain in your own look, the pack's in the pack's look.

ClassWhat it isMarkup
pk-tabs, pk-taba tab strip; the chosen tab has on<div class="pk-tabs"><button class="pk-tab on">Routes</button><button class="pk-tab">Loops</button></div>
pk-togglea segmented toggle; the chosen side has on<div class="pk-toggle"><button class="on">Profit</button><button>Time</button></div>
pk-btna small button; on lights its lamp<button class="pk-btn">${CA.lamp("")} Run</button>
pk-leda plain lamp: ok, warn, bad light it (what CA.lamp gives in your own look)<i class="pk-led ok"></i>
pk-screena readout's dark glass, its text lit in the lamp colour<div class="pk-screen">12,400</div>
pk-tablethe table (above); build it with CA.tableCA.table(cols, rows)

In the pack's look, the angular packs cut the corners of buttons, toggles and screens; the round ones keep them round (CA.pack.round).

The helpers (in every frame):

  • CA.lamp(level): the pack's own lamp for a level ("ok", "warn", "bad", "off", or "" for unlit), as HTML. In your own look, a pk-led.
  • CA.table(cols, rows, empty): the table's HTML. cols: [{kind: "text" | "num" | "lamp" | "bar", label, w}] (w: a share of the width). rows: [{cells: [one per column], level, on}]; a lamp cell takes a level (or the row's), a bar cell 0..1. empty: the text when there are no rows.
  • CA.fitTable(el): after the table is in the page, folds the rows that don't fit el into "+N more".

The example add-on's Tap board (on the developer pages) uses all of it in both looks.

Coming (planned)

  • Internal names you may see in the pad's page (generated layer classes like .l12) aren't part of any API and change whenever the art does: never rely on them.
From the Comms Array source, commsarray-agent d615c4d.