.dev

Modules1 min read

Broadcast

Observer HUD and follow cameras for tournaments.

broadcast:1Tier A · Decorate

Good for

  • Tournament casting with a team overlay
  • Follow cameras for observers and streams

Broadcast tools are for tournament casters and observers: a team overlay that reads like a sports broadcast, and server-driven cameras that follow players.

Observer HUD

Java
Observer.Builder hud = Observer.builder("Skyline Cup · Grand final").subtitle("Map 3 · Lighthouse");

hud.team("Red", 0xFF5555).score(2)
        .player(alexId, "Alex", 18, true, 4, "diamond_sword")
        .player(samId, "Sam", 0, false, 1, "bow");
hud.team("Blue", 0x4DA9FF).score(1)
        .player(jordanId, "Jordan", 12, true, 3, "iron_axe");

caster.broadcast().observer(hud.build());
caster.broadcast().observer(Observer.off());

Each player row takes a UUID, a name, health, whether they are alive, kills and the held item. Send it again whenever the score or a player changes.

Follow cameras

Java
caster.broadcast().follow(alexId, BroadcastApi.Follow.ORBIT, 6, true);
caster.broadcast().follow(samId, BroadcastApi.Follow.FIRST_PERSON, 0, true);
caster.broadcast().stopFollowing();

Modes are THIRD_PERSON, FIRST_PERSON and ORBIT. The distance applies to third-person and orbit, and smooth eases between targets.

Pair it with camera cutscenes for map fly-overs between rounds.