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

    Function createTileGrid

    • Creates a grid of tiles using a set of textures

      Parameters

      • options: GridOptions

        Configuration options for the grid

      • textures: Texture<TextureSource<any>>[]

        Array of textures to use for the tiles

      • Optionalselector: (position: CellPosition) => number

        Optional function to select which texture to use for each cell

      Returns Container

      A PIXI Container with the generated tile grid

      // Create a random grass field
      const grassField = createTileGrid({
      width: 64,
      height: 64,
      cellWidth: 16,
      cellHeight: 16,
      centered: true
      }, grassTextures);