home *** CD-ROM | disk | FTP | other *** search
- /*
- Control Tower Arexx Script
- Written By J.L. White
- (C)1995 Merlin's Software
- Lines=8
- 01=Moving Brush
- 02=
- 03=This script loads each image of the File List Window
- 04=into ImageFX and allows the user to add a brush image
- 05=that will move from X1 Y1 to X2 Y2 over the total number
- 06=of frames. The user selects where to begin and where to
- 07=end and what brush to use. You also have the option to
- 08=add a shadow or even to use just the shadow itself.
-
- */
-
- options results
-
- arg FrameNum TotalNum
- address "IMAGEFX.1"
-
- Start = 0
- if FrameNum = 0 then do
- FrameNum = 1
- RequestFile '"Select Brush Image To Use!"'
- BrushName = result
- Gadget.1 = 'Select How To Stamp Down Brush!?'
- Gadget.2 = 'BRUSH ONLY'
- Gadget.3 = 'SHADOW ONLY'
- Gadget.4 = 'BRUSH & SHADOW'
- ListRequest 4 Gadget
- Answer2 = result
- if Answer2 = 3 | Answer2 = 4 then do
- RequestSlider '"Enter Amount To Darken Shadow!"' 1 100 60
- Answer4 = result
- end
- if Answer2 = 4 then do
- RequestSlider '"Enter Offset For Shadow!"' 1 10 3
- Answer3 = result
- end
-
- call PickLine()
- call open TempFile,"RAM:CT-IFMB",W
- call writeln TempFile,Answer
- call writeln TempFile,Answer2
- call writeln TempFile,Answer3
- call writeln TempFile,Answer4
- call writeln TempFile,BrushName
- call close TempFile
- end
- else do
- call open TempFile,"RAM:CT-IFMB",R
- line = readln(TempFile)
- parse var line X1 Y1 X2 Y2
- line = readln(TempFile)
- parse var line Answer2
- line = readln(TempFile)
- parse var line Answer3
- line = readln(TempFile)
- parse var line Answer4
- line = readln(TempFile)
- parse var line BrushName
- call close TempFile
- end
-
- LoadBrush BrushName
- call GetXYCords
- GetBrush
- parse var result Name BWidth BHeight Blah
- BrushHandle BWidth%2 BHeight%2
-
- if Answer2 = 2 then do
- DrawMode Normal
- Point X Y
- end
- if Answer2 = 3 then do
- Blend Answer4
- DrawMode Darken
- Point X Y
- end
- if Answer2 = 4 then do
- Blend Answer4
- DrawMode Darken
- Point X+Answer3 Y+Answer3
- Blend 100
- DrawMode Normal
- Point X Y
- end
- Blend 100
- DrawMode Normal
- KillBrush
-
- exit
-
-
-
- GetXYCords:
- TotalKey = 1
- NumKey = (TotalNum/TotalKey)
- FirstNum = ((NumKey - (NumKey-(FrameNum-1)))%NumKey)+1
- SecNum = FirstNum+1
- if FirstNum = TotalKey then do
- NumKey = NumKey - 1
- NewNum = (((FrameNum-((FirstNum-1)*NumKey)))-(TotalKey-1))
- end
- else
- NewNum = ((FrameNum-((FirstNum-1)*NumKey)))
- if X2 < X1 then do
- DiffX = -((X1-X2)/(NumKey))
- end
- else do
- DiffX = ((X2-X1)/(NumKey))
- end
- if Y2 < Y1 then do
- DiffY = -((Y1-Y2)/(NumKey))
- end
- else do
- DiffY = ((Y2-Y1)/(NumKey))
- end
- X = (X1 + (DiffX*NewNum))-DiffX
- Y = (Y1 + (DiffY*NewNum))-DiffY
- X = X % 1
- Y = Y % 1
- return
-
- PickLine:
- Menu ToolBox
- RequestNotify "Draw Line From Point A To Point B For Brush Movement!"
- DrawTool Line
- HidePanel
- Undo On
- WaitFor SELECTDOWN
- parse var result X1 Y1
- WaitFor SELECTUP
- parse var result X2 Y2
- Undo
- ShowPanel
- Undo Off
- X1 = strip(X1)
- Y1 = strip(Y1)
- X2 = strip(X2)
- Y2 = strip(Y2)
- Answer = X1" "Y1" "X2" "Y2
- RequestResponse "Is The Line You Have Drawn Correct?"
- if rc ~= 0 then call PickLine()
-
- return
-