Skip to content
pixi-silk
GitHub repository
Entry point

pixi-silk/ui/island

Island, IslandFrame: surfaces that grow out of the viewport edges (side tabs, notches, bezels), plus gauges, render meters, a settings menu and createRenderStats.

import { Island, IslandFrame, IslandGauge, IslandMenu } from 'pixi-silk/ui/island';

Classes#

ClassDescription
IslandA surface that grows out of an edge of the viewport, like part of the bezel: a rounded body joined to the edge by concave flares, drawn as one exact shape. It rests as a lip you can pull out and opens on a tap or a drag. It springs between named sizes, so a notch can morph from a lip to a pill to a panel. Content fades in per state.
IslandFrameBands along the edges of the viewport with a rounded window cut out of them. The canvas reads as a device with a bezel, and the app as the screen inside it. A band can be a side rail of icons, a thin bezel, or nothing. Bands spring to new sizes with IslandFrame.setBands.
IslandGaugeA progress ring with an icon in the middle and a caption under it, for quotas, levels and loading. Its box is size wide and size + 24 high with the caption, from (0, 0). The ring eases to new values and redraws only while it moves.
IslandMenuRows of switches, choices and actions, sized for the open state of a small island: a settings menu that grows out of a gear. Its box is IslandMenu.boxWidth by IslandMenu.boxHeight from (0, 0). Switches slide when their signal changes, from a tap or from elsewhere.
IslandMeterA caption, a number and a row of bars with its recent values: FPS, frame time, draw calls or any live count. Its box is width by 64 from (0, 0). It redraws when the value changes, not every frame.
IslandStackA row or a column of items, centred across the axis. Sizes come from each item’s local bounds, so items can draw around any origin. Call IslandStack.layout again after an item changes size. An island stacks its items in one of these.

Interfaces#

InterfaceDescription
IslandFrameOptionsOptions of IslandFrame.
IslandGaugeOptionsOptions of IslandGauge.
IslandInsetsDistances from the viewport edges: notches, rounded corners, home bars. Default 0 each.
IslandMagnetHow the lip of an Island leans toward a pointer.
IslandMenuOptionsOptions of IslandMenu.
IslandMeterOptionsOptions of IslandMeter.
IslandOptionsOptions of Island.
IslandRailOptionsA column or row of items in one band of an IslandFrame, such as the icons of a side rail.
IslandRectA rectangle in the island’s parent space.
IslandShapeThe pieces of an island outline, in the parent space.
IslandShapeOptionsMore of the outline of islandShape.
IslandSizeSize of an island in one state, in edge terms.
IslandStackOptionsOptions of IslandStack.
IslandStateLive state of an Island.
RenderStatsWhat createRenderStats returns. Every signal updates once per interval.
RenderStatsOptionsOptions of createRenderStats.

Type Aliases#

Type AliasDescription
IslandEdgeSide of the viewport an island grows from.
IslandHintA hint that the island can be pulled out: pulse swells it, wiggle shakes it along the edge.
IslandMenuItemOne row of an IslandMenu.
IslandViewportWhat an island or a frame follows. An Application or a renderer updates it on resize. A signal of a rectangle, such as IslandFrame.inner, updates it on change. A plain rectangle stays as it is. The same shapes a SmartContainer takes.

Functions#

FunctionDescription
createRenderStatsSamples how the renderer is doing: frames per second, CPU time per render and draw calls per frame. Feed the signals to an IslandMeter, or read them anywhere.
drawIslandShapeFills an island outline as one shape: one instance, exact edges, safe with a see-through fill.
fpsToneGreen at 55 frames per second and up, amber from 30, red below: a tone for an FPS meter.
gearIconDraws a gear, size wide, centred on (0, 0), in white: an IconSource for a settings island.
islandShapeOutline of an island length long and depth deep, centred at u along the edge. The far corners get radius, the joins with the edge get concave flares of flare. Both shrink when the island is shallow, and the flares always meet the straight part of the sides, so the outline stays smooth at every depth. A full island ignores u and length and spans the edge. Returns null when depth is below a quarter unit.