de.matthiasmann.twl.renderer
Interface Image

All Known Subinterfaces:
DynamicImage, OffscreenSurface
All Known Implementing Classes:
AnimatedImage, EmptyImage, GradientImage, GridImage, LWJGLDynamicImage, StateSelectImage, TextureArea, TextureAreaRotated, TextureAreaTiled

public interface Image

A image object can be used for rendering.


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 width, int height)
          Draws the image scaled to the given size at the given location
 int getHeight()
          Returns the height in pixels of the image
 int getWidth()
          Returns the width in pixels of the image
 

Method Detail

getWidth

int getWidth()
Returns the width in pixels of the image

Returns:
the width in pixels of the image

getHeight

int getHeight()
Returns the height in pixels of the image

Returns:
the height in pixels of the image

draw

void draw(AnimationState as,
          int x,
          int y)
Draws the image in it's original size at the given location

Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate

draw

void draw(AnimationState as,
          int x,
          int y,
          int width,
          int height)
Draws the image scaled to the given size at the given location

Parameters:
as - A time source for animation - may be null
x - left coordinate
y - top coordinate
width - the width in pixels
height - the height in pixels

createTintedVersion

Image createTintedVersion(Color color)
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.

Parameters:
color - The color used for tinting.
Returns:
a new Image object.