flix

0.81.0

View

Definitions

def bannerSize(): Float32§ Source

The font size used for large screen banners (e.g. GAME OVER, READY).

def bannerY(): Float32§ Source

Where the game's own banners sit.

Above the middle of the field, not in it. The attract screen puts its title panel across the centre and plays the demo behind it, so a level banner at the midpoint lands inside the panel and neither can be read. TestView keeps the two apart.

def centredX(s: String, size: Float32): Float32§ Source

The x that centres s in the field.

def countdown(pause: Int32): Int32§ Source

Which number the countdown is showing, given how much of the pause is left.

One second each, taken from the rules rather than from a constant here, so the digits and the pause they divide up cannot drift apart.

def countdownSize(): Float32§ Source

Font size used for rendering the ready countdown digits.

def countdownY(): Float32§ Source

Vertical baseline coordinate for rendering the countdown digit.

def hudSize(): Float32§ Source

The HUD type size. Press Start 2P is a pixel font: whole multiples look best.

def render(w: World): Unit \ Canvas§ Source

Describes one frame of a single game, with no cabinet around it.

def renderWith(w: World, c: Cabinet): Unit \ Canvas§ Source

Describes one frame, told who else is playing.

def rightAlignedX(s: String, size: Float32, margin: Float32): Float32§ Source

The x that right-aligns s with its right edge margin from the field edge.

def scoreText(value: Int32): String§ Source

Left-pads a score with zeros, the way the cabinet displays it.

def textWidth(s: String, size: Float32): Float32§ Source

The width of a string, in pixels.

Press Start 2P is monospaced with an advance equal to the em size, so this is exact and lets the HUD be laid out by character count rather than by numbers tuned against whatever font the platform happened to supply.