I have some problems with my rendering of a 2Dimensional Map.
for (int col = 0; col <= view.getWidth () / Tile.TILE_SIZE; col ++)
{
for (int row = 0; row <= view.getHeight () / Tile.TILE_SIZE; row ++)
{
if (checkBounds ((int) topLeftX + col, (int) topLeftY + row))
{//tiles is an array of Tiles, tiles1 is the mapData
g.drawImage ((tiles[tiles1[(int) topLeftX + col][(int) topLeftY + row]].getImage ()), col * Tile.TILE_SIZE, row * Tile.TILE_SIZE, null);
}
}
}
But the scrolling of the map is not smooth (tiles move in a TILE_SIZE distance and not with pixelmovement).
Someone has an idea on how to solve this?