[SOLVED]I sometric game get what tiles to draw to the screen

I just finish drawing a 2d cartesian tile array to an isometric screen.

I now wonder how to get what tiles to draw. As my code is now it draw the tiles within the screen, but it takes the cartesian coordinates, and not the isometric tiles within the screen.

My code for selcting what tiles to draw follows here:

	public void isometricRender(int xScroll, int yScroll, Screen screen) {
		screen.setOffsets(xScroll, yScroll);
		int x0 = xScroll / Tile.WIDTH;
		int x1 = (xScroll + screen.getWidth() + Tile.WIDTH) / Tile.WIDTH - 1;
		int y0 = yScroll / Tile.HEIGHT;
		int y1 = (yScroll + screen.getHeight() + Tile.WIDTH) / Tile.WIDTH + 1;

		for (int y = y0; y < y1; y++) {
			for (int x = x0; x < x1; x++) {
				getTile(x, y).isometricRender(x, y, screen);
			}
		}

		for (int i = 0; i < _entities.size(); i++) {
			_entities.get(i).isometricRender(screen);
		}

		for (int i = 0; i < _players.size(); i++) {
			// _players.get(i).isometricRender(screen);
		}

		for (int i = 0; i < _projectiles.size(); i++) {
			_projectiles.get(i).isometricRender(screen);
		}
		for (int i = 0; i < _particles.size(); i++) {
			_particles.get(i).isometricRender(screen);
		}
	}

I need help to set the offsets so that it draws the tiles within the screen.

The game looks like this:

https://dl.dropboxusercontent.com/u/12022353/iso_draw_wrong5.png

Really appriciate you help :slight_smile: