Log inGet started
Package

grandPrixKit.package

Newest version

README.md

selectUi

Builds the kart select screen's widget tree for one style: build(state, W, H) returns the tree for a W x H canvas, and focus(styleId, W, H) answers where the 3D kart should sit on screen (sx, sy in -1..1 and a zoom) so the stage camera frames it in the gap the layout leaves. grandPrixKit.KartSelect calls both and registers the tree itself, so the clicks reach its onCallback.

state = { style, view, row, preview, touch, scale }: style is a grandPrixKit.selectStyles entry, view is the GrandPrix select view (GP.sample("select") shape), row the focused row (1 vehicle, 2 look, 3 paint, 4 ready).

Clickables carry callback ids ks:vehicle:<id>, ks:look:<id>, ks:paint:<id>, ks:ready, ks:prev, ks:next and ks:row:<n>, and element ids (ks_ready, ks_prev, ks_next, ks_card_<vehicle>, ks_look_<look>, ks_paint_<paint>, ks_row_<vehicle>) for driving it from tests.

Stat bars use barsKit's BK.render with the style's barLook (segmented, ghost, pixel, hologram) and the style's own thin bars otherwise. Below 640 points wide, or in portrait, each style switches to its phone layout. Portraits in the roster and list are the grandPrixKit.portraits.<vehicle> textures, rendered from the real vehiclesKit models.