de.matthiasmann.twl.renderer.lwjgl
Class TextureAreaRotated

java.lang.Object
  extended by de.matthiasmann.twl.renderer.lwjgl.TextureAreaRotated
All Implemented Interfaces:
Image

public class TextureAreaRotated
extends java.lang.Object
implements Image

A rotated, tiled or flipped area inside a OpenGL texture used as UI image


Field Summary
protected static int REPEAT_CACHE_SIZE
           
protected  int repeatCacheID
           
 
Constructor Summary
TextureAreaRotated(LWJGLTexture texture, int x, int y, int width, int height, Color tintColor, boolean tiled, Texture.Rotation rotation)
           
 
Method Summary
 Image createTintedVersion(Color color)
          Creates a new image with is tinted with the specified color.
 void draw(AnimationState as, int x, int y)
          Draws the image in it's original size at the given location
 void draw(AnimationState as, int x, int y, int w, int h)
          Draws the image scaled to the given size at the given location
protected  void drawRepeatCached(int x, int y, int repeatCountX, int repeatCountY)
           
 int getHeight()
          Returns the height in pixels of the image
 int getWidth()
          Returns the width in pixels of the image
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPEAT_CACHE_SIZE

protected static final int REPEAT_CACHE_SIZE
See Also:
Constant Field Values

repeatCacheID

protected int repeatCacheID
Constructor Detail

TextureAreaRotated

public TextureAreaRotated(LWJGLTexture texture,
                          int x,
                          int y,
                          int width,
                          int height,
                          Color tintColor,
                          boolean tiled,
                          Texture.Rotation rotation)
Method Detail

getHeight

public int getHeight()
Description copied from interface: Image
Returns the height in pixels of the image

Specified by:
getHeight in interface Image
Returns:
the height in pixels of the image

getWidth

public int getWidth()
Description copied from interface: Image
Returns the width in pixels of the image

Specified by:
getWidth in interface Image
Returns:
the width in pixels of the image

draw

public void draw(AnimationState as,
                 int x,
                 int y)
Description copied from interface: Image
Draws the image in it's original size at the given location

Specified by:
draw in interface Image
Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate

draw

public void draw(AnimationState as,
                 int x,
                 int y,
                 int w,
                 int h)
Description copied from interface: Image
Draws the image scaled to the given size at the given location

Specified by:
draw in interface Image
Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate
w - the width in pixels
h - the height in pixels

drawRepeatCached

protected void drawRepeatCached(int x,
                                int y,
                                int repeatCountX,
                                int repeatCountY)

createTintedVersion

public Image createTintedVersion(Color color)
Description copied from interface: Image
Creates a new image with is tinted with the specified color. Tinting works by multiplying the color of the image's pixels with the specified color.

Specified by:
createTintedVersion in interface Image
Parameters:
color - The color used for tinting.
Returns:
a new Image object.