home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDOperators / ScaleToSize.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  1.5 KB  |  85 lines

  1. /*
  2. ** ScaleToSize.fred.pre
  3. **
  4. ** $VER: ScaleToSize.fred.pre 1.2.1 (17.1.94)
  5. **
  6. ** If the ScaleToSize.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user to enter a width and height value.
  8. **
  9. ** Clips Exported:
  10. **    FREDDesiredWidth    -    Width user entered
  11. **    FREDDesiredHeight    -    Height user entered
  12. **
  13. ** NOTE: Clip names are case sensitive.
  14. **
  15. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  16. ** ADPro v2.5.0 (or higher).
  17. **
  18. ** Copyright © 1993-1994 ASDG, Incorporated
  19. ** All Rights Reserved
  20. */
  21.  
  22.  
  23. ADDRESS "ADPro"
  24. OPTIONS RESULTS
  25.  
  26. PARSE ARG NumberOfCells NumberOfFrames
  27.  
  28. NL = '0A'X
  29. SQ = '27'X
  30. DQ = '22'X
  31. TRUE  = 1
  32. FALSE = 0
  33.  
  34.  
  35. /*
  36. ** Set some default values.
  37. */
  38.  
  39. CurrentWidth  = 320
  40. CurrentHeight = 200
  41.  
  42.  
  43. /*
  44. ** See what type of data is loaded in ADPro/MorphPlus.
  45. */
  46.  
  47. CALL "FREDSCRIPTS:FREDFunctions/CheckForImageData" FALSE
  48. IF (RESULT = 0) THEN DO
  49.     XSIZE
  50.     CurrentWidth = ADPRO_RESULT
  51.  
  52.     YSIZE
  53.     CurrentHeight = ADPRO_RESULT
  54. END
  55.  
  56.  
  57. /*
  58. ** Ask the user for a size using the currently loaded width as default.
  59. */
  60.  
  61. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Scale Width"' CurrentWidth 1 999999 TRUE
  62. IF (RESULT = (1-1)) THEN
  63.     EXIT 10
  64. DesiredWidth = RESULT
  65.  
  66.  
  67. /*
  68. ** Ask the user for a size using the currently loaded height as default.
  69. */
  70.  
  71. CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Scale Height"' CurrentHeight 1 999999 TRUE
  72. IF (RESULT = (1-1)) THEN
  73.     EXIT 10
  74. DesiredHeight = RESULT
  75.  
  76.  
  77. /*
  78. ** Update the clips.
  79. */
  80.  
  81. SETCLIP( "FREDDesiredWidth", DesiredWidth )
  82. SETCLIP( "FREDDesiredHeight", DesiredHeight )
  83.  
  84. EXIT 0
  85.