drawPosition

View sourcedrawPosition(world: World): void

Draws a white marker at every entity’s current Position2D.

Physics2DDebuggerPlugin registers this exact function directly in the repeating AppSchedule.Update schedule when its drawPosition option is enabled. The query requires Position2D; each matching position becomes a filled white circle with radius 4 on the main window’s 2D canvas.

As with the other debugger overlays, the system finds the entity matching MainWindow together with its EntityHandle and resolves its canvas through the Windows resource. The world must provide that main-window match and resource. A missing canvas or unavailable 2D context causes an immediate return without drawing.

Examples

import { AppSchedule } from '@wimaengine/core'
import { drawPosition } from '@wimaengine/physics'

app.registerSystem({
  schedule: AppSchedule.Update,
  system: drawPosition
})
// Physics2DDebuggerPlugin registers this when drawPosition is enabled.

Parameters

NameDescriptionDefault
world

World containing Position2D components and the main window.

—