Configuration options for the 2D renderer plugin.
Supports two modes:
app
init
ecs.initialize()
This plugin includes transform propagation automatically - no need to add createTransformPlugin() separately.
const app = new Application();await app.init({ resizeTo: window });const ecs = ECSpresso.create() .withPlugin(createRenderer2DPlugin({ app })) .withComponentTypes<{ player: true }>() .build(); Copy
const app = new Application();await app.init({ resizeTo: window });const ecs = ECSpresso.create() .withPlugin(createRenderer2DPlugin({ app })) .withComponentTypes<{ player: true }>() .build();
const ecs = ECSpresso.create() .withPlugin(createRenderer2DPlugin({ init: { background: '#1099bb', resizeTo: window }, container: document.body, })) .withComponentTypes<{ player: true }>() .build();await ecs.initialize(); // Application created here Copy
const ecs = ECSpresso.create() .withPlugin(createRenderer2DPlugin({ init: { background: '#1099bb', resizeTo: window }, container: document.body, })) .withComponentTypes<{ player: true }>() .build();await ecs.initialize(); // Application created here
Configuration options for the 2D renderer plugin.
Supports two modes:
appinitoptions and the plugin creates the Application duringecs.initialize()This plugin includes transform propagation automatically - no need to add createTransformPlugin() separately.