Hullo,
I am working on a client GUI for a turn-based strategy game. I have a random map generator in place which creates all the map data, which I then render in the GUI. Currently, I have a randomish color picker that plots points out to distinguish the different terrain types. This works ok, but I’m wondering if there might be a way to paint some sort of texture, or use an image as a texture, etc. This screenshot should show what I mean. It shows the current pixel-method. I’m also including a little code that shows how the pixel-method works for one of the terrain types.
http://empireforge.com/images/EFC/pixelGUI.png
private void drawForestPixel( int x, int y ) {
int selector = viewer.main.Main.RAND.nextInt( 10 );
switch( selector ) {
case 0:
buffer.setColor( DARKER_GREEN );
break;
case 1:
buffer.setColor( TRUNK );
break;
case 2:
buffer.setColor( LIGHTER_GREEN );
break;
default:
buffer.setColor( FOREST_GREEN );
break;
}
buffer.drawLine( x, y, x, y );
}
