mwg API
    Preparing search index...

    Class Shape2D

    Vector drawing - rectangles, circles, polygons, lines - under an MWG-owned name.

    Pixi's own Graphics API (.rect(...).fill(...), .circle(...).stroke(...), moveTo/ lineTo) is already the right shape for this; wrapping it class-for-method would only duplicate an API this project does not own and would drift from every Pixi upgrade. The bare re-export is what lets a game draw shapes without importing pixi.js itself.

    import { Shape2D } from '@datamoc/mw_games/two-d/render';

    const marker = new Shape2D().circle(0, 0, 6).fill(0xff4040).stroke({ color: 0x000000, width: 1 });
    marker.x = 100;
    marker.y = 60;

    Hierarchy

    • Graphics
      • Shape2D
    Index
    • Creates a new Graphics object.

      Parameters

      • Optionaloptions: GraphicsContext | GraphicsOptions

        Options for the Graphics.

      Returns Shape2D