/** * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer) */ public void init(GameContainer container) throws SlickException { poly.addPoint(120, 120); poly.addPoint(420, 100); poly.addPoint(620, 420); poly.addPoint(300, 320); image = new Image("testdata/rocks.png"); texPaint = new TexCoordGenerator() { public Vector2f getCoordFor(float x, float y) { float tx = (texRect.getX() - x) / texRect.getWidth(); float ty = (texRect.getY() - y) / texRect.getHeight(); return new Vector2f(tx,ty); } }; }