home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Roll.fred.pre
- **
- ** $VER: Roll.fred.pre 1.2.1 (17.1.94)
- **
- ** If the Roll.fred script appears in the InvokeADPro list, this program will
- ** ask the user to enter the number of pixels to roll, in what direction, and
- ** whether to wrap the image or not.
- **
- ** Clips Exported:
- ** FREDRollPixels - Number of pixels to roll
- ** FREDRollDirection - Direction to roll pixels
- ** FREDRollWrap - How to wrap the image
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1993-1994 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ask the user for a pixel aspect to scale to.
- */
-
- DirectionID.1 = "DOWN"
- DirectionID.2 = "LEFT"
- DirectionID.3 = "UP"
- DirectionID.4 = "RIGHT"
- DirectionID.5 = "UPLEFT"
- DirectionID.6 = "UPRIGHT"
- DirectionID.7 = "DOWNRIGHT"
- DirectionID.8 = "DOWNLEFT"
- MinDirectionID = 1
- MaxDirectionID = 8
- DefDirectionID = 1
-
- String = '"' || DirectionID.DefDirectionID || '"'
- DO LoopCounter = MinDirectionID TO MaxDirectionID
- String = String '"' || DirectionID.LoopCounter || '"'
- END
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- LISTVIEW '"Roll Direction:"' (MaxDirectionID-MinDirectionID+1) ITEMS String
- LISTVIEW_RC = RC
- PARSE VAR ADPRO_RESULT '"'DirectionStr'"' scratch
-
- IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"Roll.fred"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
-
- DirectionSelected = MinDirectionID
- DO WHILE (DirectionSelected <= MaxDirectionID) & (COMPARE( DirectionStr, DirectionID.DirectionSelected ) ~= 0)
- DirectionSelected = DirectionSelected + 1
- END
-
- RollDirection = DirectionID.DirectionSelected
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter pixels to roll"' 1 1 240 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- RollPixels = RESULT
-
- ADPRO_TO_FRONT
-
- OKAYN '"Roll.fred"' '"Wrap image?"' '"Wrap Around|No Wrapping|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE IF (RC = 1) THEN
- RollWrap = "WRAP"
- ELSE IF (RC = 2) THEN
- RollWrap = "NO_WRAP"
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDRollPixels", RollPixels )
- SETCLIP( "FREDRollDirection", RollDirection )
- SETCLIP( "FREDRollWrap", RollWrap )
-
- EXIT 0
-