Skip to content
Docs
Reference

world global

The physical world of a running match, generated from the shipped declarations.

Generated from the declarations in @disko-game/build/types. world is usable only while a match runs, between the start and stop events. See World & physics for a guide.

The world global

The physical world of the running match.

ts

World

Disko.Filtered

Collision groups shared by every collidable object.

ts
MemberDescription
setAcceptedGroups()Only objects in one of these groups collide with this one.

Disko.Collidable

Shared collision settings.

ts

Disko.CollisionState

Collision properties of contact geometry, as read by state().

ts
MemberDescription
groupsSorted memberships.
acceptedGroupsSorted accepted groups.

Disko.DiscState

A disc's state at the current tick.

ts
MemberDescription
velocityPer-tick displacement.
gravityPer-tick acceleration.
inverseMassReciprocal mass; zero is immune to contact response.

Disko.PlaneState

A plane's state.

ts
MemberDescription
normalNormalized inward direction.

Disko.VertexState

A vertex's state.

ts

Disko.SegmentState

A segment's state. start and end are the vertices' engine handles.

ts
MemberDescription
curveCurve factor, or null for a straight segment.

Disko.JointState

A joint's state. first and second are the discs' engine handles.

ts

Disko.CrossingState

A crossing's state.

ts
MemberDescription
groupsSorted memberships.
acceptedGroupsSorted accepted groups.

Disko.PhysicalState

The physical state of an object at the current tick.

ts

Disko.DiscAppearance

Paint of a disc. Colors are #rrggbb or #rrggbbaa.

ts
MemberDescription
strokeWidthOutline width in CSS pixels, 0 to 64; zero hides it.

Disko.Disc

A physical disc.

ts

Disko.Plane

An infinite collision plane.

ts

Disko.Vertex

A fixed collision point, also the endpoint of segments.

ts

Disko.Segment

A straight or curved segment between two vertices.

ts
MemberDescription
setCurve()Curvature in radians; null for a straight segment.

Disko.Joint

A distance constraint between two discs.

ts

Disko.Crossing

A line that reports discs crossing it (crossing events).

ts

Disko.PhysicalObject

Any physical object.

ts

Disko.DiscOptions

ts

Disko.PlaneOptions

ts

Disko.VertexOptions

ts

Disko.SegmentOptions

ts

Disko.JointOptions

ts

Disko.CrossingOptions

ts
MemberDescription
groupsNamed memberships, in addition to the default membership.

Disko.VisualAnchor

Where a world visual is drawn.

ts

Disko.VisualAudience

Which players see a world visual. Exclusions take precedence.

ts
MemberDescription
includeOmitted: everyone; empty: nobody.

Disko.TextVisualAppearance

Upright centered text, outlined for readability.

ts
MemberDescription
textAt most 256 UTF-8 bytes; no control characters.
sizingworld (default) follows camera zoom; screen is CSS pixels.
color#rrggbb or #rrggbbaa.

Disko.RingVisualAppearance

A circular stroke, without collisions.

ts
MemberDescription
radiusA fixed radius, or the anchor body's radius plus a gap.
widthStroke width in world units.
color#rrggbb or #rrggbbaa.

Disko.VisualAppearance

ts

Disko.VisualOptions

ts
MemberDescription
layerNamed rendering layer; exclusive with order.
orderRelative to the anchor body; attached visuals default to above it.

Disko.VisualPatch

A change to a world visual. An appearance of the same type is merged into the current one; a different type replaces it.

ts

Disko.Visual

A non-physical world visual, such as a name label or a ring.

ts

Disko.World

The physical world of the running match. Only usable between start and stop.

ts
MemberDescription
setLayerOrder()Draw order of disc layers, back to front.