debugDraw method
void
debugDraw(})
Draws the grid data as colored rects. Tiles with a value smaller than 0 are skipped.
Implementation
void debugDraw(Canvas canvas,
{Vec2? position,
AABB? cullArea,
List<Color> palette = const [
Color(0xFFFFB74D),
Color(0xFF64B5F6),
Color(0xFF81C784),
Color(0xFFE57373),
Color(0xFFBA68C8),
Color(0xFF4DD0E1),
Color(0xFFFFD54F),
Color(0xFFA1887F),
]}) {
final paint = Paint();
forEachDrawArea(
visit: (screenX, screenY, tile) {
paint.color = palette[tile % palette.length];
canvas.drawRect(
Rect.fromLTWH(
screenX,
screenY,
cellSize.toDouble(),
cellSize.toDouble(),
),
paint,
);
},
position: position,
cullArea: cullArea,
);
}