home *** CD-ROM | disk | FTP | other *** search
/ DarkBASIC - The Ultimate 3D Game Creator / PCactive 8 CD1 - DarkBasic.iso / SOFTWARE / DEMOS / DarkForge2000 / snippets_vol1 / snip_bitmap_tiling.dba < prev    next >
Encoding:
Text File  |  2000-06-06  |  713 b   |  37 lines

  1. `    ------------------------------------------------------------------------
  2. `    Bitmap Tiling                               DarkForge Snippet (6/6/2000)
  3. `    ------------------------------------------------------------------------
  4. `
  5. `    This will take a small bitmap and fill the screen with it.
  6. `    Just like the HTML "background" command.
  7.  
  8. sync rate 0
  9. sync on
  10. hide mouse
  11.  
  12. load bitmap "bg_grape.bmp",1
  13. get image 1,0,0,bitmap width(1),bitmap height(1)
  14.  
  15. set current bitmap 0
  16.  
  17. tx=screen width()/bitmap width(1)
  18. ty=screen height()/bitmap height(1)
  19.  
  20. for a=0 to ty
  21.  
  22.     for b=0 to tx
  23.         paste image 1,x,y
  24.         inc x,bitmap width(1)
  25.     next b
  26.  
  27.     x=0
  28.     inc y,bitmap height(1)
  29.  
  30. next a
  31.  
  32. sync
  33.  
  34. wait key
  35. end
  36.  
  37.