Advertisement

Getting the first field to be drawn

Started by December 21, 1999 09:09 AM
2 comments, last by ThePrime 24 years, 11 months ago
Instead of using a "viewpoint" why don't you just use the first-tile as your reference point? Then have an X offset and Y offset that are pixel perfect. When they hit a limit (0 or the size of the tile) the first tile changes.
-the logistical one-http://members.bellatlantic.net/~olsongt
(let me translate this into my own jargon to see if i understand the problem correctly)

so, you have a screenspace with the anchor on (0,0), and this anchor corresponds to some point in tilespace, right? and you want to know how to test for partially visible tiles.

if this is the problem, you only need to test for the corners. you translate the screenspace coordinates into tilespace coordinates, then translate the tilespace coordinates into tilemap coordinates using a mousemap.

Get off my lawn!

Advertisement
I am writing an isoengine which is capable of (smooth) scrolling. I think you now the technique... I have a "viewpoint" which represents the current screenposition on the isomap (the vp is relative to the 0, 0 screencoordinate). Now I need a fast function that gives me the position and fieldnumber (row/col) of the first field (tile) to be drawn. My first (totally unserious) idea was just to check each pixel: convert some coordinates and see if there is a tile (have that formula) Of course it was more a joke - imagine how slow this would be. After I would have calculated the first tile, I could go on with the normal drawing. Now I need a better function (can it be worse?) for this purpose. Thanks in advance.
If you draw from left to right, top to bottom, why don't you just convert the pixel in the upper left of the screen into tile-coordintates? Is your map irregular?

This topic is closed to new replies.

Advertisement