getBlockRenderedAt method

Block getBlockRenderedAt(
  1. Vector2 p
)

Get which block should be rendered on position p.

This is the opposite of getBlockRenderPosition.

Implementation

Block getBlockRenderedAt(Vector2 p) {
  final tile = effectiveTileSize;
  return getBlock(
    _blockPositionCache
      ..setFrom(p)
      ..translate(
        (tile.x / 2) * scale.x,
        (tile.y - effectiveTileHeight - tile.y / 4) * scale.y,
      ),
  );
}