1 package org.newdawn.slick; 2 3 import org.newdawn.slick.geom.Shape; 4 import org.newdawn.slick.geom.Vector2f; 5 6 import javax.annotation.Nonnull; 7 8 /** 9 * A filling method for a shape. This allows changing colours at shape vertices and 10 * modify they're positions as required 11 * 12 * @author kevin 13 */ 14 public interface ShapeFill { 15 16 /** 17 * Get the colour that should be applied at the specified location 18 * 19 * @param shape The shape being filled 20 * @param x The x coordinate of the point being coloured 21 * @param y The y coordinate of the point being coloured 22 * @return The colour that should be applied based on the control points of this gradient 23 */ 24 @Nonnull 25 public Color colorAt(Shape shape, float x, float y); 26 27 /** 28 * Get the offset for a vertex at a given location based on it's shape 29 * 30 * @param shape The shape being filled 31 * @param x The x coordinate of the point being drawn 32 * @param y The y coordinate of the point being drawn 33 * @return The offset to apply to this vertex 34 */ 35 @Nonnull 36 public Vector2f getOffsetAt(Shape shape, float x, float y); 37 }