mako5.gfx
Interface Image

All Known Implementing Classes:
DefaultImage, MaskedImage

public interface Image

A generic image interface. Provides the ability to render, resize, and destroy an image as appropriate.

Version:
04-Jun 2006
Author:
Paul Jarrett

Method Summary
 boolean destroy()
          Attempts to reclaim image memory components.
 int getHeight()
          Accessor method for the height of this image.
 int getWidth()
          Accessor method for the width of this image.
 boolean isDestroyed()
          Used to determine if this image has been destroyed.
 void render(float x_, float y_)
          Draws this image to the screen.
 void renderAt(float x_, float y_)
          Draws this image to the screen such that it is centered at the given location.
 boolean resize(int width_, int height_)
          Attempts to resize this image.
 

Method Detail

render

void render(float x_,
            float y_)
Draws this image to the screen. The image is drawn so that the top left corner of the image is at the desired location. Destroyed images have no image data and therefore cannot be rendered.

Parameters:
x_ - the x-coordinate to render at
y_ - the y-coordinate to render at

renderAt

void renderAt(float x_,
              float y_)
Draws this image to the screen such that it is centered at the given location.

Parameters:
x_ - the x-coordinate to render at
y_ - the y-coordinate to render at
Since:
30-Jun 2006

destroy

boolean destroy()
Attempts to reclaim image memory components. Note that this makes the image unusable afterwards.

Returns:
true if succeeds, false otherwise

isDestroyed

boolean isDestroyed()
Used to determine if this image has been destroyed.

Returns:
true if this image is destroyed

resize

boolean resize(int width_,
               int height_)
Attempts to resize this image.

Parameters:
width_ - the new image width
height_ - the new image height
Returns:
true if the operation is successful.

getWidth

int getWidth()
Accessor method for the width of this image.

Returns:
the width of this image

getHeight

int getHeight()
Accessor method for the height of this image.

Returns:
the height of this image