3 ms·
Well, you'll want to think one level of abstraction higher than that. Imagine a camera. When you push a camera forward towards a wall, the wall stays the same s
by sillysaurus 13y ago
Well, you'll want to think one level of abstraction higher than that. Imagine a camera. When you push a camera forward towards a wall, the wall stays the same size. It just fills more of your view.
You can code the equivalent of that pretty simply. So even if a png is 13x13, it might be drawn as 30x30 if the camera zooms in, or as 5x5 if the camera zooms out.
It's actually much simpler (and more visually consistent) to do it that way. It's probably more difficult to learn, but it's well worth the time spent learning it.
- graue 13y agoA 13×13 .png of line art stretched to 30×30 or 5×5 is gonna look pretty ugly[1]. Am I misinterpreting you? [1] I tried it: http://toxicsli.me/file/hexes.png http://toxicsli.me/file/hexes.png Leftmost is original, others resized.
- jonmrodriguez 13y agoUse vector image files
- mpyne 13y agoThat just brings him back to the original problem though. His code was doing the equivalent of rendering a vector image of a hexagon already.
- sillysaurus 13y agoWell, two things to consider: (a) that particular example looks fine to me on a MacBook Pro in Chrome, and (b) you've discovered the motivation for mipmapping.