@@ -0,0 +1,2446 @@
+package de.gurkenlabs.litiengine.graphics;%0A%0Aimport java.awt.Color;%0Aimport java.awt.Graphics2D;%0Aimport java.awt.RenderingHints;%0Aimport java.awt.geom.Ellipse2D;%0Aimport java.awt.image.BufferedImage;%0A%0Aimport de.gurkenlabs.litiengine.entities.Creature;%0Aimport de.gurkenlabs.util.ImageProcessing;%0A%0Apublic class CreatureShadowImageEffect extends ImageEffect %7B%0A  private static final Color DEFAULT_SHADOW_COLOR = new Color(124, 164, 174, 120);%0A%0A  private final Creature creature;%0A  private final Color shadowColor;%0A%0A  public CreatureShadowImageEffect(final Creature creature) %7B%0A    this(creature, DEFAULT_SHADOW_COLOR);%0A  %7D%0A%0A  public CreatureShadowImageEffect(final Creature creature, final Color shadowColor) %7B%0A    super(0, %22shadow%22);%0A    this.creature = creature;%0A    this.shadowColor = shadowColor;%0A  %7D%0A%0A  public Creature getCreature() %7B%0A    return this.creature;%0A  %7D%0A%0A  @Override%0A  public BufferedImage apply(BufferedImage image) %7B%0A    if (this.getCreature().isDead()) %7B%0A      return image;%0A    %7D%0A%0A    final BufferedImage buffer = ImageProcessing.getCompatibleImage(image.getWidth() * 2 + 2, image.getHeight() * 2);%0A    final Graphics2D graphics = buffer.createGraphics();%0A%0A    this.drawShadow(graphics, image.getWidth(), image.getHeight());%0A%0A    graphics.drawImage(image, 0, 0, null);%0A    graphics.dispose();%0A    return buffer;%0A  %7D%0A%0A  protected Ellipse2D getShadowEllipse(final int spriteWidth, final int spriteHeight) %7B%0A    final double ellipseWidth = 0.60 * spriteWidth;%0A    final double ellipseHeight = 0.20 * spriteWidth;%0A    final double startX = (spriteWidth - ellipseWidth) / 2.0;%0A    final double startY = spriteHeight - ellipseHeight;%0A    return new Ellipse2D.Double(startX, startY, ellipseWidth, ellipseHeight);%0A  %7D%0A%0A  private void drawShadow(final Graphics2D graphics, final int spriteWidth, final int spriteHeight) %7B%0A    graphics.setColor(this.shadowColor);%0A    final RenderingHints hints = graphics.getRenderingHints();%0A    graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);%0A    graphics.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);%0A    graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);%0A    graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);%0A%0A    graphics.fill(getShadowEllipse(spriteWidth, spriteHeight));%0A    graphics.setRenderingHints(hints);%0A  %7D%0A%7D%0A

Add a creature shadow image effect to the engine.