render method

  1. @override
void render(
  1. Canvas canvas
)
override

Implementation

@override
void render(Canvas canvas) {
  final size = effectiveTileSize;
  for (var i = 0; i < matrix.length; i++) {
    for (var j = 0; j < matrix[i].length; j++) {
      final element = matrix[i][j];
      if (element != -1) {
        _renderSprite = tileset.getSpriteById(element);
        final blockPosition = getBlockRenderPositionInts(j, i);
        _renderSprite.render(
          canvas,
          position: blockPosition,
          size: size,
        );
      }
    }
  }
}