draw tiles with caching