de.matthiasmann.twl.renderer.lwjgl
Class TextureAreaTiled

java.lang.Object
  extended by de.matthiasmann.twl.renderer.lwjgl.TextureAreaBase
      extended by de.matthiasmann.twl.renderer.lwjgl.TextureArea
          extended by de.matthiasmann.twl.renderer.lwjgl.TextureAreaTiled
All Implemented Interfaces:
Image, QueriablePixels, SupportsDrawRepeat

public class TextureAreaTiled
extends TextureArea

A tiled area inside a OpenGL texture used as UI image


Field Summary
 
Fields inherited from class de.matthiasmann.twl.renderer.lwjgl.TextureArea
REPEAT_CACHE_SIZE, repeatCacheID, texture, tintColor
 
Fields inherited from class de.matthiasmann.twl.renderer.lwjgl.TextureAreaBase
height, tx0, tx1, ty0, ty1, width
 
Constructor Summary
TextureAreaTiled(LWJGLTexture texture, int x, int y, int width, int height, Color tintColor)
           
 
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, int w, int h)
          Draws the image scaled to the given size at the given location
 
Methods inherited from class de.matthiasmann.twl.renderer.lwjgl.TextureArea
createRepeatCache, draw, draw, drawRepeat, drawRepeatCached, getPixelValue
 
Methods inherited from class de.matthiasmann.twl.renderer.lwjgl.TextureAreaBase
getHeight, getWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.renderer.Image
getHeight, getWidth
 

Constructor Detail

TextureAreaTiled

public TextureAreaTiled(LWJGLTexture texture,
                        int x,
                        int y,
                        int width,
                        int height,
                        Color tintColor)
Method Detail

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
Overrides:
draw in class TextureArea
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

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
Overrides:
createTintedVersion in class TextureArea
Parameters:
color - The color used for tinting.
Returns:
a new Image object.