@moxijs/core - v0.3.4
    Preparing search index...

    Function asEntityGraphics

    • Creates a Graphics instance wrapped as an entity for logic support.

      Parameters

      Returns AsEntity<Graphics>

      const player = asEntityGraphics({
      x: 100,
      y: 200,
      draw: (g) => g.circle(0, 0, 20).fill(0xff0000)
      });
      player.moxiEntity.addLogic(new PlayerController());
      scene.addChild(player);