MapView

from acron.hud import MapView
class MapView(parent: NodePath, width: float, height: float, *, name: str = 'mapview', node: NodePath | None = None)

Bases: object

A baked top-down map, windowed by a texture transform.

The map is one texture covering a square of world — (cx, cz) at its centre, half metres to each edge — drawn with its NORTH edge (world z = cz - half) at the top, which is how every map is drawn and how Raster uploads a raster. focus() then decides which part of it the card shows.

Nothing is re-blitted per frame: panning, zooming and rotating are a TransformState on the card’s texture stage, so the cost is the same whether the map moves or not. That is what makes a per-frame minimap affordable in Python.

Games draw their markers on top — a transparent Raster over the same card, or pooled sprites — using world_to_local().

The map frame is the Y-up ground plane: world (x, z) with north at -z. A Z-up game (ground plane x/y, north +y) crosses it with one convention at its call sites — z = -y — which is how the Arena’s radar consumes this class; nothing inside needs to know.

np lets a game supply its own node instead of the generated card (the radar’s disc, a bent quad): the map texture and the focus transform are applied to that node, whose UVs must span (0,0)-(1,1) in the card convention (north at the top). The supplied node’s transparency and placement stay the caller’s business; width/height remain the pixel frame world_to_local() answers in.

Inheritance diagram

digraph inheritance3eb0efb6b5 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "MapView" [URL="acron.hud.MapView.html#acron.hud.MapView",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="A baked top-down map, windowed by a texture transform."]; }