public static void drawFire( Graphics renderer, final Animation<Frame> animFire, final Image light, final float fireX, final float fireY, final int lightShine) { // Draw the fire renderer.setColor(new Color4f(1f, 1f, 1f, 1f)); renderer.translate(-(fireX - animFire.getWidth() / 2), -(fireY - animFire.getHeight() / 2)); animFire.draw(renderer, animFire.getWidth(), animFire.getHeight()); renderer.clearTransformation(); }
public static void drawLight( Graphics graphics, final Animation<Frame> anim, final Image light, final float x, final float y, int lightShine) { final int shineRadX = 128 + lightShine; final int shineRadY = 96 + lightShine; final float lightPosX = x + anim.getWidth() / 2 - shineRadX; final float lightPosY = y + anim.getHeight() / 4 * 3 - shineRadY; graphics.setColor(new Color4f(.0f, .0f, .0f, 1f)); graphics.setDrawingMode(DrawingMode.MULTIPLY); // graphics.setColorMask(false, false, false, true); graphics.translate(-lightPosX / 4, -lightPosY / 4); graphics.drawImage(light, shineRadX * 2 / 4, shineRadY * 2 / 4); graphics.clearTransformation(); graphics.setDrawingMode(DrawingMode.ALPHA_BLEND); // graphics.setColorMask(true, true, true, true); }