net.petterroea.starterkit
Class FontShader

java.lang.Object
  extended by net.petterroea.starterkit.FontShader

public class FontShader
extends java.lang.Object

THIS IS NOT ACTUALLY A SHADER!!!
It is a piece of code that you use for manipulating the font, like adding fancy sine waves^^
To use it, create a instance of this, and override the doPixel method.

Author:
petterroea

Constructor Summary
FontShader()
           
 
Method Summary
 int doPixel(int x, int y, int src, int screenx, int screeny)
          Override this to edit pixels
 java.awt.image.BufferedImage render(java.awt.image.BufferedImage src, int screenx, int screeny)
          You should not pay attention to this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontShader

public FontShader()
Method Detail

render

public java.awt.image.BufferedImage render(java.awt.image.BufferedImage src,
                                           int screenx,
                                           int screeny)
You should not pay attention to this. It is used by the Font class to modify a letter. Can be used for all BufferedImages, tho ;)(hint, hint)

Parameters:
src - The source image
screenx - X coordinate on screen that the image is going to be drawn
screeny - Y coordinate on screen that the image is going to be drawn
Returns:
A modified, edited, manimpulated image

doPixel

public int doPixel(int x,
                   int y,
                   int src,
                   int screenx,
                   int screeny)
Override this to edit pixels

Parameters:
x - The x coordinate in the image
y - The y coordinate in the image
src - The rgb color value. (HINT: Use Color(src) to and Color.getRed() and so on to get the different colors, and then Color.setRed() and so on and Color.getRGB() to get the returning int
screenx - X coordinate on the screen that the IMAGE is drawn. Use screenx + x to get the absolute position
screeny - Y coordinate on the screen that the IMAGE is drawn. Use screeny + y to get the absolute position.
Returns:
The rgb color to put back into the image.