跳转到内容

EntityBoxOptions

此内容尚不支持你的语言。

Defined in: sdk/src/ecs/entityBox.ts:47

optional extentOf?: (entity) => { height: number; width: number; x: number; y: number; } | null

Defined in: sdk/src/ecs/entityBox.ts:63

The drawn extent of an entity whose size is not in a component the box reads — a skeleton, a tilemap: a rectangle in the entity’s own units, x/y its lower-left corner from the origin. Scaled and turned by the world transform like a sprite’s.

number

{ height: number; width: number; x: number; y: number; } | null


optional iconHalf?: number | ((at) => number)

Defined in: sdk/src/ecs/entityBox.ts:57

World half-size for an entity that draws nothing of its own — a camera, a light, an empty. Zero (the default) reports no box for those; an editor that wants them clickable passes the size of the icon it drew.

A function when that size is not a world size: an icon drawn at a fixed number of PIXELS covers a world extent that depends on where it is, and the caller is handed the entity’s world position to answer for it.