Optionaloptions: BoundsPluginOptions<G>const ecs = ECSpresso
.create<Components, Events, Resources>()
.withResource('bounds', createBounds(800, 600))
.withPlugin(createTransformPlugin())
.withPlugin(createBoundsPlugin())
.build();
// Entity that gets destroyed when leaving screen
ecs.spawn({
...createTransform(100, 200),
...createDestroyOutOfBounds(),
});
Create a bounds plugin for ECSpresso.
This plugin provides:
Uses worldTransform for position checking (world-space) and modifies localTransform for corrections. Works best with entities that don't have parent transforms (orphan entities).