ecspresso
    Preparing search index...

    Function createTransformPlugin

    • Create a transform plugin for ECSpresso.

      This plugin provides:

      • Transform propagation system that computes world transforms from local transforms
      • Parent-first traversal ensures parents are processed before children
      • Supports full transform hierarchy (position, rotation, scale)

      Type Parameters

      • G extends string = "transform"

      Parameters

      Returns Plugin<
          WorldConfigFrom<TransformComponentTypes>,
          EmptyConfig,
          "transform-propagation",
          G,
      >

      const ecs = ECSpresso
      .create<Components, Events, Resources>()
      .withPlugin(createTransformPlugin())
      .withPlugin(createPhysics2DPlugin())
      .build();

      // Spawn entity with transform
      ecs.spawn({
      ...createTransform(100, 200),
      velocity: { x: 50, y: 0 },
      });