home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / Gamelication / com / next / gt / RCS / TiledImage.java,v < prev    next >
Text File  |  1998-04-15  |  1KB  |  61 lines

  1. head    1.1;
  2. access;
  3. symbols;
  4. locks; strict;
  5. comment    @# @;
  6.  
  7.  
  8. 1.1
  9. date    98.04.10.17.53.01;    author jgh8962;    state Exp;
  10. branches;
  11. next    ;
  12.  
  13.  
  14. desc
  15. @@
  16.  
  17.  
  18. 1.1
  19. log
  20. @Initial revision
  21. @
  22. text
  23. @/**
  24.  *
  25.  * TiledImage.java
  26.  * @@author    Mark G. Tacchi (mtacchi@@next.com) 
  27.  * @@version    0.8
  28.  * Feb 24/1996
  29.  * 
  30.  * TiledImage is a simple class with the sole responsibility of
  31.  * replicating an image tile to produce a large tiled image.  This is
  32.  * useful for creating a background image.
  33.  * 
  34. */
  35.  
  36. package com.next.gt;
  37.  
  38. import java.awt.Graphics;
  39. import java.awt.Image;
  40.  
  41.  
  42. public class TiledImage extends java.lang.Object {
  43.   static Image        tiledImage;
  44.  
  45. public static Image createTiledImage(Image theImage, int width, int height,
  46.                      Gamelication owner) {
  47.   int        i, j;
  48.   
  49.   tiledImage= owner.createImage(width,height);
  50.   for (i= 0; i< width; i+= theImage.getWidth(null)) {
  51.     for (j= 0; j< height; j+= theImage.getHeight(null)) {
  52.       tiledImage.getGraphics().drawImage(theImage,i,j,owner);
  53.     }
  54.   }
  55.   return tiledImage;
  56. } /*TiledImage(,,,)*/
  57.  
  58.  
  59. } /*TiledImage*/
  60. @
  61.