I do something similar in my debug modes, by outputting the values of the byte arrays im working with on the screen with my font class, if you’re asking for what I think you are… this method should output the entire byte array on-screen spaced out like a tiled base map:
//Location of your map, you'll need other methods to change this value to move your map around on the screen. But this will start your generation at 0,0 NOTE: Since you are dealing with ASCII you will probably be fine just using ints instead of floats.
float mapX = 0;
float mapY = 0;
int mapWidth = ??; //Width of the map.
int mapHeight = ??; //Height of the map.
int displayWidth = ??; //Screen size width.
int displayHeight = ??; //Screen size height.
int spacing = ??; //How far apart you want you ASCII "tiles" on your tile map.
byte[][] yourMap = new byte[mapWidth][mapHeight]; //Create byte array matching map height/width. (May need to be an int[][] or whatever[][] depending on what you're doing)
//YOUR CODE TO FILL SAID BYTE/INT/CHAR/WHATEVER ARRAY WITH YOUR "ASCII MAP"!//
//Start looping through the entire byte array.
for (int x = 0; x < mapWidth; x++) {
for (int y = 0; y < mapHeight; y++) {
// Check to see if the coordinates being looked for are visible on the screen. If not, don't bother rendering them.
if ((x*spacing+mapX > -10) && (x*spacing+mapX < displayWidth+10) && (y*spacing+mapY > -10) && (y*spacing+mapY < displayHeight+10)){
if (!(yourMap[x][y] == 0)){ //Assuming 0 is a "blank space", but whatever == Blank space here, so you're not trying to output nothing.
//However you output the text would go here. For example, if you were using the Font class in slick2d:
font.drawString((x*spacing)+mapX, (y*spacing)+mapY, yourMap[x][y]);
//So basically, however you call it, the coords would be (x*spacing)+mapX, (y*spacing)+mapY and you'll be calling character yourMap[x][y].
}
}
}
}