WorldSystems extension
Finding and making a world's systems.
- on
Properties
- hierarchyVersion → int
-
Available on World, provided by the WorldSystems extension
A number that goes up whenever an object is added, destroyed, shown, hidden or given a new parent: while it stays the same, every object's parent is what it was.no setter - isOnScreen → bool
-
Available on World, provided by the WorldSystems extension
Whether the world has been shown on screen (WorldSystem.viewStarted).no setter - transformVersion → int
-
Available on World, provided by the WorldSystems extension
A number that goes up whenever an object's transform, parent or layer is set. While it stays the same, no object's world transform or layer has changed, so a system that follows objects has nothing to read.no setter
Methods
-
addAssetKind(
AssetKind< Object> kind) → void -
Available on World, provided by the WorldSystems extension
Lets Assets.preload load files ending inkind's AssetKind.extensions; Assets.load needs no adding. Throws an ArgumentError if another kind has one of them. -
maybeSystem<
T extends WorldSystem> () → T? -
Available on World, provided by the WorldSystems extension
The world's system of typeT, or null if it has none yet. -
movedReader(
) → MovedReader -
Available on World, provided by the WorldSystems extension
A new reader of the world's moved log, which starts reading here: every object whose transform, parent or layer is set from now on is in it, at least once, until the reader reads past it. MovedReader.close it when done. -
readWorldTransforms(
Pointer< Uint64> ids, int count, Pointer<Float> out) → void -
Available on World, provided by the WorldSystems extension
Reads the world transforms ofcountobjects, by their GameObject.ids atids, intoout: ten 32-bit floats each, the position (x, y, z), the rotation (x, y, z, w) and the scale (x, y, z), as the engine works them out (from its matrices: GameObject.worldTransform's, but for a rotation under an uneven scale). One call however many there are; the moves set since the last send are sent first. Throws an ArgumentError if an id isn't a live object. -
report(
GameObject? object, Object error, StackTrace stack) → void -
Available on World, provided by the WorldSystems extension
Sends what a game's code threw from a call a system made (a physics callback, say) to World.errors, forobjectif it's one's: the system goes on. -
system<
T extends WorldSystem> (T make(World world)) → T -
Available on World, provided by the WorldSystems extension
The world's system of typeT, made withmakethe first time. Throws a StateError if the world was disposed. -
writeTransforms(
Pointer< Uint64> ids, int count, Pointer<Float> transforms) → void -
Available on World, provided by the WorldSystems extension
Sets the transforms ofcountobjects, by their GameObject.ids atids, fromtransforms: ten 32-bit floats each, as readWorldTransforms writes them, but each relative to its object's parent, as GameObject.transform is. For a package that works out many poses natively (an animator, particles): one call however many there are, each sent with the frame's other moves. Throws an ArgumentError if an id isn't a live object or a transform isn't valid; those before it are set.