Life, the Internet, and Everything!

How Do You Use IndexColorModel ( Java )? I have …

Comment on How to Colorize Your Source Code in SEU by Austin.

How Do You Use IndexColorModel ( Java )? I have a custom font file* and I need to be able to change it into every color, so creating different colored font files is out of the question. I’ve been trying to change them pixel by pixel, but it was taking too long and it didn’t keep the alpha from the original pixels for some reason.

So I looked up that IndexColorModel would be the way to go, but I’ve been searching but I can’t figure out how it works. I need to change the white pixels to be displayed as the current color. This is my current code:

byte[] red = new byte[ 8 ];
byte[] grn = new byte[ 8 ];
byte[] blu = new byte[ 8 ];

for ( int i = 0; i < 8; i++ ) {    red[ i ] = ( byte ) color.getRed();    grn[ i ] = ( byte ) color.getGreen();    blu[ i ] = ( byte ) color.getBlue(); } * not really a font file, just a png file split into 16 x 16 squares that get loaded individually, each one containing it's own character. The characters are white with anti-aliasing on them. Please help, I'm really trying to make my first game and this is really stopping me from actually being able to carry on with the game.

Next Post

What Will The Next Generation Of Aspiring Entrepreneurs Look Like?