phaser - v4.0.0-rc.4
    Preparing search index...
    • Returns a Vector2 containing the x and y position of the given index in a width x height sized grid.

      For example, in a 6 x 4 grid, index 16 would equal x: 4 y: 2.

      If the given index is out of range an empty Vector2 is returned.

      Parameters

      • index: number

        The position within the grid to get the x/y value for.

      • width: number

        The width of the grid.

      • height: number

        The height of the grid.

      • Optionalout: Math.Vector2

        An optional Vector2 to store the result in. If not given, a new Vector2 instance will be created.

      Returns Math.Vector2