ecspresso
    Preparing search index...

    Type Alias Renderer2DPluginOptions<G>

    Renderer2DPluginOptions:
        | Renderer2DPluginAppOptions<G>
        | Renderer2DPluginManagedOptions<G>

    Configuration options for the 2D renderer plugin.

    Supports two modes:

    1. Pre-initialized: Pass an already-initialized Application via app
    2. Managed: Pass init options and the plugin creates the Application during ecs.initialize()

    This plugin includes transform propagation automatically - no need to add createTransformPlugin() separately.

    Type Parameters

    • G extends string = "renderer2d"
    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