home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / various / sprite's_to_iff.amos / sprite's_to_iff.amosSourceCode
AMOS Source Code  |  1993-01-08  |  1KB  |  33 lines

  1. ' This Program will convert your sprite file to a picture. 
  2. ' each sprite will have it's own border around it so you can easily grab 
  3. ' the sprite's back at a later date. 
  4. '                      Program written by Brett George   
  5. Screen Open 0,320,256,32,0
  6. Paper 0 : Cls 0 : Curs Off : Ink 1 : Flash Off 
  7. Centre "Sprite's to iff converter"
  8. Print : Cmove ,2
  9. A$=Fsel$("*.Abk","","Please choose sprite","bank to be converted to iff")
  10. If A$="" Then Print "You must select a file!" : Edit 
  11. If Exist(A$)=False Then Print "File does not exist" : Edit 
  12. Load A$
  13. If Length(1)=False Then Print "You must load a sprite file" : Edit 
  14. Print "You have a total of";Length(1);" Sprites.    "
  15. Input "Which sprite should I draw first?";SS
  16. If SS=0 Then SS=1
  17. Get Sprite Palette : Cls 0
  18. For Z=SS To Length(1)
  19.    XX=Deek(Sprite Base(Z))*16
  20.    YY=Deek(Sprite Base(Z)+2)
  21.    If YY>CY Then Add BY,YY : CY=YY
  22.    If X+XX>320 Then Add Y,CY+6 : X=0 : CY=0
  23.    Exit If Y+YY+3>256
  24.    Box X,Y To X+XX+3,Y+YY+3
  25.    Hot Spot Z,0
  26.    Paste Bob X+2,Y+2,Z
  27.    Add X,XX+6
  28.    Wait 10
  29. Next 
  30. Save Iff Fsel$("","Sprites.Iff","Please choose name to save","Iff picture.")
  31. Print Z-1;"/";
  32. Print Str$(Length(1))-" ";" Sprites printed to screen"
  33. Erase 1