SDF-2D - v0.8.0
    Preparing search index...
    • Creates a drawable droplet class with a shared color.

      Parameters

      Returns typeof DropletBase

      A class with constructor new Droplet(from: vec2, to: vec2, fromRadius: number, toRadius: number). from and to are endpoint positions in world coordinates; fromRadius and toRadius are the radii at those endpoints in world units. Pass the class's static descriptor to compile!compile, then pass instances to graphics/rendering/renderer/renderer!Renderer.addDrawable.

      import { DropletFactory } from 'sdf-2d';

      const Droplet = DropletFactory([1, 0.5, 0]);
      const droplet = new Droplet([100, 100], [200, 140], 30, 10);