org.jtgl.image
Class ImageMatrix

java.lang.Object
  extended by org.jtgl.image.ImageMatrix

public class ImageMatrix
extends java.lang.Object

Represents a group of equal sized images arranged in a 2D Matrix within a single big source image. This class serves as an access point for Sprites and TileSets (see TiledSurface class)

Author:
Manuel Polo (manuel_polo at yahoo dot es)
See Also:
TiledSurface

Constructor Summary
ImageMatrix(JTGLImage imageSource, int frameWidth)
          Creates a new instance of ImageMatrix suited for square dimensions
ImageMatrix(JTGLImage imageSource, int frameWidth, int frameHeight)
           
 
Method Summary
 void draw(JTGLGraphics g, int x, int y, int imageIndex)
          Draw a single image located by imageIndex at location (x,y)
 void draw(JTGLGraphics g, int x, int y, int offsetX, int offsetY, int imageIndex)
           
 int getImageHeight()
           
 int getImageWidth()
           
 int getNumHImages()
           
 int getNumImages()
           
 int getNumVImages()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageMatrix

public ImageMatrix(JTGLImage imageSource,
                   int frameWidth,
                   int frameHeight)

ImageMatrix

public ImageMatrix(JTGLImage imageSource,
                   int frameWidth)
Creates a new instance of ImageMatrix suited for square dimensions

Method Detail

getImageWidth

public int getImageWidth()

getImageHeight

public int getImageHeight()

getNumImages

public int getNumImages()

getNumHImages

public int getNumHImages()

getNumVImages

public int getNumVImages()

draw

public void draw(JTGLGraphics g,
                 int x,
                 int y,
                 int imageIndex)
Draw a single image located by imageIndex at location (x,y)


draw

public void draw(JTGLGraphics g,
                 int x,
                 int y,
                 int offsetX,
                 int offsetY,
                 int imageIndex)