# ShapeRenderer (Slick - The 2D Library)
Date: 2013-06-03

## org.newdawn.slick.geom
Class ShapeRenderer

    java.lang.Object
      org.newdawn.slick.geom.ShapeRenderer

    public final class ShapeRenderer

extends java.lang.Object

Author:
  Mark Bernard Use this class to render shpaes directly to OpenGL. Allows you to bypass the Graphics class.

Constructor Summary
`ShapeRenderer()`

Method Summary
`static void` `draw(Shape shape)` Draw the outline of the given shape.
`static void` `draw(Shape shape, ShapeFill fill)` Draw the outline of the given shape.
`static void` `fill(Shape shape)` Draw the the given shape filled in.
`static void` `fill(Shape shape, ShapeFill fill)` Draw the the given shape filled in.
`static void` `texture(Shape shape, Image image)` Draw the the given shape filled in with a texture.
`static void` `texture(Shape shape, Image image, float scaleX, float scaleY)` Draw the the given shape filled in with a texture.
`static void` `texture(Shape shape, Image image, float scaleX, float scaleY, ShapeFill fill)` Draw the the given shape filled in with a texture.
`static void` `texture(Shape shape, Image image, TexCoordGenerator gen)` Draw the the given shape filled in with a texture.
`static void` `textureFit(Shape shape, Image image)` Draw the the given shape filled in with a texture.
`static void` `textureFit(Shape shape, Image image, float scaleX, float scaleY)` Draw the the given shape filled in with a texture.
`static boolean` `validFill(Shape shape)` Check there are enough points to fill

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ShapeRenderer

    public ShapeRenderer()

Method Detail

### draw

    public static final void draw(Shape shape)

  Draw the outline of the given shape. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to draw.

### draw

    public static final void draw(Shape shape,
                                  ShapeFill fill)

  Draw the outline of the given shape. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to draw.
    `fill` - The fill to apply

### validFill

    public static boolean validFill(Shape shape)

  Check there are enough points to fill

  Parameters:
    `shape` - THe shape we're drawing
  Returns:
    True if the fill is valid

### fill

    public static final void fill(Shape shape)

  Draw the the given shape filled in. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to fill.

### texture

    public static final void texture(Shape shape,
                                     Image image)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape

### textureFit

    public static final void textureFit(Shape shape,
                                        Image image)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method. This method is required to fit the texture once across the shape.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape

### texture

    public static final void texture(Shape shape,
                                     Image image,
                                     float scaleX,
                                     float scaleY)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape
    `scaleX` - The scale to apply on the x axis for texturing
    `scaleY` - The scale to apply on the y axis for texturing

### textureFit

    public static final void textureFit(Shape shape,
                                        Image image,
                                        float scaleX,
                                        float scaleY)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method. This method is required to fit the texture scaleX times across the shape and scaleY times down the shape.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape
    `scaleX` - The scale to apply on the x axis for texturing
    `scaleY` - The scale to apply on the y axis for texturing

### fill

    public static final void fill(Shape shape,
                                  ShapeFill fill)

  Draw the the given shape filled in. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to fill.
    `fill` - The fill to apply

### texture

    public static final void texture(Shape shape,
                                     Image image,
                                     float scaleX,
                                     float scaleY,
                                     ShapeFill fill)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape
    `scaleX` - The scale to apply on the x axis for texturing
    `scaleY` - The scale to apply on the y axis for texturing
    `fill` - The fill to apply

### texture

    public static final void texture(Shape shape,
                                     Image image,
                                     TexCoordGenerator gen)

  Draw the the given shape filled in with a texture. Only the vertices are set. The colour has to be set independently of this method.

  Parameters:
    `shape` - The shape to texture.
    `image` - The image to tile across the shape
    `gen` - The texture coordinate generator to create coordiantes for the shape

Copyright © 2006 New Dawn Software. All Rights Reserved.