I’m wondering if any one knows a javascript formula which calculates the max number of tiles that would appear on the user’s screen at any given time based on their screen size…
For example:
If we say the screen size is 1200pixels by 600pixels and the tiles are 64 pixels by 32 pixels.
In a birds eye view this is easy to calculate but isometric kinda makes it all a bit more confusing for me to understand how to implement such a calculation in my code.
Does any one have any insight how to calculate it ?
Assuming you are counting only tiles that fit fully (without getting cut-off):
If you want to count also tiles that fit partially (getting cut off by the window), just change both instances of
Math.floortoMath.ceilabove.