Measure distance between two points.

pf1.utils.measureDistance(token, game.user.targets.first());
  • Parameters

    • p0: Point

      Start point on canvas

    • p1: Point

      End point on canvas

    • Optionaloptions: {
          diagonalRule: undefined | "5105" | "555";
          ray: undefined | Ray;
          state: any;
      } = {}

      Measuring options.

      • diagonalRule: undefined | "5105" | "555"

        Used diagonal rule. Defaults to 5/10/5 PF measuring.

      • ray: undefined | Ray

        Pre-generated ray to use instead of the points.

      • state: any

        Optional state tracking across multiple measures.

    Returns number

    • Grid distance between the two points.