ringWalls(pieces: { Piece }, r: number, segments: number, gaps: number) → void
| arg | type | description |
|---|
| pieces | { Piece } | |
| r | number | |
| segments | number | |
| gaps | number | |
spawnPoints(pieces: { Piece }, r: number, n: number, prefix: string) → void
| arg | type | description |
|---|
| pieces | { Piece } | |
| r | number | |
| n | number | |
| prefix | string | |
describe(id: string) → any
| arg | type | description |
|---|
| id | string | |
defineLayout(id: string, info: { label: string?, description: string?, tags: { string }? }, fill: (pieces: { Piece }, plan: Plan, r: number) → void
Add a layout of your own. `fill(pieces, plan, radius)` appends pieces
(the outer ring wall, gates and starts are already there) and may set
plan.shrink / plan.lanes.
| arg | type | description |
|---|
| id | string | |
| info | { label: string?, description: string?, tags: { string }? } | |
| fill | (pieces: { Piece }, plan: Plan, r: number | |
plan(id: string, opts: PlanOpts?) → Plan
The pieces of one layout, centred on 0,0. Pure: no engine calls.
| arg | type | description |
|---|
| id | string | |
| opts | PlanOpts? | |
count(plan: Plan) → void
Count the pieces of each kind in a plan (handy for tests and tools).
| arg | type | description |
|---|
| plan | Plan | |
defineTheme(name: string, t: Theme) → void
Register a theme: functions that draw each piece. Colliders are added by
the builder, so every theme blocks the same way.
| arg | type | description |
|---|
| name | string | |
| t | Theme | |
theme(name: string) → Theme
| arg | type | description |
|---|
| name | string | |
box(e: any, sx: number, sy: number, sz: number, mat: any, tint: { number }?) → void
| arg | type | description |
|---|
| e | any | |
| sx | number | |
| sy | number | |
| sz | number | |
| mat | any | |
| tint | { number }? | |
prop(e: any, kind: string, seed: number, scale: number?) → boolean
| arg | type | description |
|---|
| e | any | |
| kind | string | |
| seed | number | |
| scale | number? | |
use(kits: { spawner: any?, materials: any? }) → void
Hand in optional kits: `spawner` (spawnerKit.api or anything with
addSpawnPoint(entity, { group, kind })) and `materials` (name -> material
for the themes). Pass false to clear one.
| arg | type | description |
|---|
| kits | { spawner: any?, materials: any? } | |
material(name: string) → any
The material handed in under `name`, or nil.
| arg | type | description |
|---|
| name | string | |
desertMat(name: string) → any
| arg | type | description |
|---|
| name | string | |
pfx(plan: Plan?) → string
| arg | type | description |
|---|
| plan | Plan? | |
floor(root: ?, radius: ?, plan: ?) → void
| arg | type | description |
|---|
| root | ? | |
| radius | ? | |
| plan | ? | |
pillar(e: ?, p: ?) → void
bunker(e: ?, _p: ?) → void
floor(root: ?, radius: ?, plan: ?) → void
| arg | type | description |
|---|
| root | ? | |
| radius | ? | |
| plan | ? | |
pillar(e: ?, p: ?) → void
bunker(e: ?, _p: ?) → void
dressing(root: ?, plan: ?) → void
| arg | type | description |
|---|
| root | ? | |
| plan | ? | |
quatYaw(yaw: number) → void
builder
| arg | type | description |
|---|
| yaw | number | |
addBoxCollider(e: any, sx: number, sy: number, sz: number) → void
| arg | type | description |
|---|
| e | any | |
| sx | number | |
| sy | number | |
| sz | number | |
build(id: string, opts: BuildOpts?) → void
Build a layout in a scene's `content()` (or any time). Returns the root
entity and the plan. Spawn gates become spawnerKit SpawnPoints (group
`<prefix>Gates`) when spawnerKit is installed; starts are named
`<prefix>Start1..4`.
| arg | type | description |
|---|
| id | string | |
| opts | BuildOpts? | |
withDefaults(defaults: { [string]: any }) → any
A view of this module whose plan() and build() use `defaults` for any
option the caller leaves out (for example { prefix = "TS" }). Everything
else is shared with the module.
| arg | type | description |
|---|
| defaults | { [string]: any } | |
merged(opts: any?) → any
| arg | type | description |
|---|
| opts | any? | |
plan(id: string, opts: any?) → void
| arg | type | description |
|---|
| id | string | |
| opts | any? | |
build(id: string, opts: any?) → void
| arg | type | description |
|---|
| id | string | |
| opts | any? | |