ui

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package ui is a drop-in Ebitengine overlay for the Mills Arcade leaderboard. A game calls StartRun when play begins, Begin(score) at game over, then routes Update/Draw to the overlay while Active. The overlay asks the player whether to submit (nothing is ever sent unless they say yes), takes three initials, does the proof-of-work spread across frames, and shows the resulting top ten.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Overlay

type Overlay struct {
	// contains filtered or unexported fields
}

Overlay is one game's leaderboard front-end. Zero value is not usable; call New.

func New

func New(game string) *Overlay

New returns an overlay for the given game slug, talking to the production leaderboard.

func (*Overlay) Active

func (o *Overlay) Active() bool

Active reports whether the overlay wants input and drawing. While true the game must route Update/Draw here and ignore its own game-over keys.

func (*Overlay) Begin

func (o *Overlay) Begin(score int64)

Begin shows the opt-in prompt for a finished run. A non-positive score is nothing worth boarding, so the overlay stays inactive.

func (*Overlay) Draw

func (o *Overlay) Draw(dst *ebiten.Image)

Draw renders the overlay onto dst (a no-op while inactive). The layout is derived from dst's size, so it adapts to every cabinet's resolution.

func (*Overlay) StartRun

func (o *Overlay) StartRun()

StartRun opens a leaderboard session in the background. Call once per run, when the player actually starts playing (never for attract mode).

func (*Overlay) Update

func (o *Overlay) Update() bool

Update advances the overlay one tick and reports whether it just finished (submitted, declined or failed) this tick.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL