Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.7.11
    Preparing search index...

    Function metersToPixels

    • Convert physics position (meters) to screen position (pixels).

      IMPORTANT: This function only handles scaling conversion between meters and pixels. It does NOT account for arena position offsets (bounds.x and bounds.y). Callers must add these offsets separately when rendering to screen.

      Example:

      const pixelPos = metersToPixels(physicsPos, bounds);
      const screenX = bounds.x + pixelPos.x; // Add arena offset
      const screenY = bounds.y + pixelPos.y; // Add arena offset

      This conversion should ONLY be used at render time. Internal game logic should always work in meters.

      Korean: 미터를픽셀로 (Meters To Pixels)

      Parameters

      Returns { x: number; y: number }

      Position in pixels RELATIVE to arena origin (add bounds.x/y for screen position)

      Error if position is invalid