DebugRegistry
Defined in: types.ts:104
Service interface for the debug registry.
Methods
Section titled “Methods”drawVector()
Section titled “drawVector()”drawVector(
entity,vector,options?): () =>void
Defined in: types.ts:137
Draw an arrow on entity for a vector that is read fresh every frame —
velocity, aim direction, knockback, steering output.
// tryResolve, not use(): use() throws without DebugPlugin installed.const debug = this.context.tryResolve(DebugRegistryKey);this.stopArrow = debug?.drawVector(this.entity, () => agent.velocity, { scale: 0.35, color: 0x4ade80, minLength: 1,});The arrow starts at the entity’s world position (plus options.origin)
and points along the vector. Nothing is retained but the provider itself:
it is called once per frame while the overlay is on and the vectors
contributor’s arrows flag is enabled, and not at all otherwise — a
drawVector call in a hot path costs nothing while debug is off.
Returns a disposer that stops the drawing. Calling it twice is harmless. The registration is also dropped when the entity’s life ends — destroyed, or a pool member whose lease ended — so a provider closure never outlives the entity it draws for, and a per-lease registration never accumulates.
Parameters
Section titled “Parameters”entity
Section titled “entity”Entity
vector
Section titled “vector”options?
Section titled “options?”Returns
Section titled “Returns”() => void
isEnabled()
Section titled “isEnabled()”isEnabled():
boolean
Defined in: types.ts:106
Returns
Section titled “Returns”boolean
isFlagEnabled()
Section titled “isFlagEnabled()”isFlagEnabled(
contributorName,flag):boolean
Defined in: types.ts:109
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
Returns
Section titled “Returns”boolean
register()
Section titled “register()”register(
contributor):void
Defined in: types.ts:105
Parameters
Section titled “Parameters”contributor
Section titled “contributor”Returns
Section titled “Returns”void
setFlag()
Section titled “setFlag()”setFlag(
contributorName,flag,value):void
Defined in: types.ts:111
Set whether a contributor’s named view is drawn.
Parameters
Section titled “Parameters”contributorName
Section titled “contributorName”string
string
boolean
Returns
Section titled “Returns”void
toggle()
Section titled “toggle()”toggle():
void
Defined in: types.ts:108
Switch all debug drawing on or off.
Returns
Section titled “Returns”void
Coding agents: fetch https://yage.dev/llms.txt first and prefer the Markdown references it links over these HTML pages. This page's Markdown counterpart is /llms/packages/debug.md.