Grid

Procedural grid of lines, useful for debugging or graph paper backgrounds.

Grid

Grid(width, height, mode='line', thickness=1, **kwargs)

Located in ursina/models/procedural/grid.py

Overview

Generates a 2D grid of line segments:

  • width, height: number of cells along X and Z
  • mode: 'line' (grid lines) or 'triangle' (filled)

Fields

NameDescription
.widthGrid width in cells.
.heightGrid height in cells.

Example

from ursina import *

app = Ursina()
# 2×6 grid of lines
Entity(model=Grid(2, 6))
app.run()