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#
| Class | Description |
|---|---|
| Island | A 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. |
| IslandFrame | Bands 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. |
| IslandGauge | A 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. |
| IslandMenu | Rows 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. |
| IslandMeter | A 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. |
| IslandStack | A 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#
| Interface | Description |
|---|---|
| IslandFrameOptions | Options of IslandFrame. |
| IslandGaugeOptions | Options of IslandGauge. |
| IslandInsets | Distances from the viewport edges: notches, rounded corners, home bars. Default 0 each. |
| IslandMagnet | How the lip of an Island leans toward a pointer. |
| IslandMenuOptions | Options of IslandMenu. |
| IslandMeterOptions | Options of IslandMeter. |
| IslandOptions | Options of Island. |
| IslandRailOptions | A column or row of items in one band of an IslandFrame, such as the icons of a side rail. |
| IslandRect | A rectangle in the island’s parent space. |
| IslandShape | The pieces of an island outline, in the parent space. |
| IslandShapeOptions | More of the outline of islandShape. |
| IslandSize | Size of an island in one state, in edge terms. |
| IslandStackOptions | Options of IslandStack. |
| IslandState | Live state of an Island. |
| RenderStats | What createRenderStats returns. Every signal updates once per interval. |
| RenderStatsOptions | Options of createRenderStats. |
Type Aliases#
| Type Alias | Description |
|---|---|
| IslandEdge | Side of the viewport an island grows from. |
| IslandHint | A hint that the island can be pulled out: pulse swells it, wiggle shakes it along the edge. |
| IslandMenuItem | One row of an IslandMenu. |
| IslandViewport | What 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#
| Function | Description |
|---|---|
| createRenderStats | Samples 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. |
| drawIslandShape | Fills an island outline as one shape: one instance, exact edges, safe with a see-through fill. |
| fpsTone | Green at 55 frames per second and up, amber from 30, red below: a tone for an FPS meter. |
| gearIcon | Draws a gear, size wide, centred on (0, 0), in white: an IconSource for a settings island. |
| islandShape | Outline 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. |