LabelPool¶
from acron.hud import LabelPool
- class LabelPool(parent: NodePath, *, scale: float = 1.0, font=None, name: str = 'labels')¶
Bases:
objectPooled ``TextNode``s over a raster, in the raster’s own pixel frame.
A pixel buffer can draw everything an instrument needs except its type. Rasterising a font by hand would be the wrong answer twice over — Acron already has a text engine, and glyphs drawn at HUD sizes want hinting this module has no business reimplementing. So text rides alongside: same coordinates, different node.
Labels are re-used frame to frame.
begin()rewinds the pool,text()claims the next one,end()hides whatever was not claimed — so an instrument whose label count changes does not leave the previous frame’s strings on screen.Every setter is guarded against writing the same value. A
TextNoderebuilds its geometry whenever any of its properties is assigned, changed or not, so an instrument that re-states its labels sixty times a second pays to re-tesselate type that has not moved. Most HUD labels change once a second at most, and this is where that saving is taken.Inheritance diagram
digraph inheritance94cb93eed7 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "LabelPool" [URL="acron.hud.LabelPool.html#acron.hud.LabelPool",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="Pooled ``TextNode``s over a raster, in the raster's own pixel frame."]; }