home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
text
/
Motion_ToolKit.rx
< prev
next >
Wrap
Text File
|
2000-04-09
|
6KB
|
394 lines
/*
Arexx Text Script
*/
call addlib("rexxmathlib.library", 5, -30, 0)
options results
parse ARG Port x y b
ADDRESS value Port
pp_AvoidRefresh
pp_GetDepth
Dp=result
ADDRESS COMMAND
file="Ram:T/pp_text"
IF OPEN('a',file,'R') then DO
trash=READLN('a')
trash=READLN('a')
Tsize=READLN('a')
Ttype=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
Txdpi=READLN('a')
Tydpi=READLN('a')
Trot=READLN('a')
Tita=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
trash=READLN('a')
Tw=READLN('a')
Th=READLN('a')
CALL CLOSE('a')
Start_Rotation=Trot
End_Rotation=Trot
Start_Italic=Tita
End_Italic=Tita
Start_Size=Tsize
End_Size=Tsize
Start_Xdpi=Txdpi
End_Xdpi=Txdpi
Start_Ydpi=Tydpi
End_Ydpi=Tydpi
OS=0
Start_Frame=1
End_Frame=10
END
ELSE
DO
ADDRESS value Port
pp_Warn 'Make*a*Text*first.'
pp_PermitRefresh
EXIT
ADDRESS COMMAND
END
file="Ram:T/pp_blur"
IF OPEN('b',file,'R') then DO
Start_Rotation=READLN('b')
End_Rotation=READLN('b')
Start_Italic=READLN('b')
End_Italic=READLN('b')
Start_Size=READLN('b')
End_Size=READLN('b')
Start_Xdpi=READLN('b')
End_Xdpi=READLN('b')
Start_Ydpi=READLN('b')
End_Ydpi=READLN('b')
OS=READLN('b')
End_Frame=READLN('b')
CALL CLOSE('b')
END
R=-1
ADDRESS value Port
Path=0;Type=0
DO UNTIL R>-1
D.4='*Rotation*(*'||Start_Rotation||'*->*'||End_Rotation||'*)*'
D.5='*Italic*(*'||Start_Italic||'*->*'||End_Italic||'*)*'
D.6='*Size*(*'||Start_Size||'*->*'||End_Size||'*)*'
D.7='*ScaleX*(*'||Start_Xdpi||'*->*'||End_Xdpi||'*)*'
D.8='*ScaleY*(*'||Start_Ydpi||'*->*'||End_Ydpi||'*)*'
pp_DialogInit 250 240 "*BLUR*" 9
pp_Cycle 0 70 5 100 16 "Path" 1 "None|Left|Right|Up|Down" Path
pp_Cycle 1 70 25 100 16 "Type" 1 "In|Out" Type
pp_Cycle 2 70 45 100 16 "Mode" 1 "Opacity|Spray" OS
pp_Integer 3 70 75 50 16 "Amount" 1 End_Frame
pp_
j=105
DO i=4 to 8
pp_Button i 20 j 200 16 D.i
j=j+20
END
pp_Dialog
R=result
pp_GetDialog 0
Path=result
pp_GetDialog 1
Type=result
pp_GetDialog 2
OS=result
pp_GetDialog 3
End_Frame=result
if R=-6 then DO
pp_DialogInit 150 80 "*SIZE*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Size
pp_Integer 1 60 25 50 16 "End" 1 End_Size
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Size=result
pp_GetDialog 1
End_Size=result
END
END
if R=-7 then DO
pp_DialogInit 150 80 "*SCALE*X*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Xdpi
pp_Integer 1 60 25 50 16 "End" 1 End_Xdpi
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Xdpi=result
pp_GetDialog 1
End_Xdpi=result
END
END
if R=-8 then DO
pp_DialogInit 150 80 "*SCALE*Y*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Ydpi
pp_Integer 1 60 25 50 16 "End" 1 End_Ydpi
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Ydpi=result
pp_GetDialog 1
End_Ydpi=result
END
END
if R=-4 then DO
pp_DialogInit 150 80 "*ROTATION*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Rotation
pp_Integer 1 60 25 50 16 "End" 1 End_Rotation
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Rotation=result
pp_GetDialog 1
End_Rotation=result
END
END
if R=-5 then DO
pp_DialogInit 150 80 "*ITALIC*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Italic
pp_Integer 1 60 25 50 16 "End" 1 End_Italic
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Italic=result
IF Start_Italic>45 then DO
Start_Italic=45
END
IF Start_Italic<-45 then DO
Start_Italic=-45
END
pp_GetDialog 1
End_Italic=result
IF End_Italic>45 then DO
End_Italic=45
END
IF End_Italic<-45 then DO
End_Italic=-45
END
END
END
END
if R=0 then DO
pp_PermitRefresh
EXIT
END
ADDRESS COMMAND
file='ram:t/pp_blur'
IF EXISTS(file) THEN DO
'delete >nil: ram:t/pp_move'
END
IF OPEN('c',file,'W') then DO
CALL WRITELN('c',Start_Rotation)
CALL WRITELN('c',End_Rotation)
CALL WRITELN('c',Start_Italic)
CALL WRITELN('c',End_Italic)
CALL WRITELN('c',Start_Size)
CALL WRITELN('c',End_Size)
CALL WRITELN('c',Start_Xdpi)
CALL WRITELN('c',End_Xdpi)
CALL WRITELN('c',Start_Ydpi)
CALL WRITELN('c',End_Ydpi)
CALL WRITELN('c',OS)
CALL WRITELN('c',End_Frame)
CALL CLOSE('c')
END
ADDRESS value Port
pp_GetWidth
W=result
pp_GetHeight
H=result
HX=Tw/2
HY=Th/2
Start_X=x
End_X=x
Start_Y=y
End_Y=y
IF Path=1 then DO
IF Type=0 then DO
Start_X=HX*-1
END
ELSE
DO
End_X=HX*-1
END
END
IF Path=2 then DO
IF Type=0 then DO
Start_X=W+HX
END
ELSE
DO
End_X=W+HX
END
END
IF Path=3 then DO
IF Type=0 then DO
Start_Y=HY*-1
END
ELSE
DO
End_Y=HY*-1
END
END
IF Path=4 then DO
IF Type=0 then DO
Start_Y=H+HY
END
ELSE
DO
End_Y=H+HY
END
END
step=(End_Frame-Start_Frame)
Step_Rotation=(End_Rotation-Start_Rotation)/Step
Step_Italic=(End_Italic-Start_Italic)/Step
Step_Xdpi=(End_Xdpi-Start_Xdpi)/Step
Step_Ydpi=(End_Ydpi-Start_Ydpi)/Step
Step_Size=(End_Size-Start_Size)/Step
Step_X=(End_X-Start_X)/Step
Step_Y=(End_Y-Start_Y)/Step
Opacity=6
Flow=5
DO i=1 to End_Frame
Rotation=trunc(Start_Rotation+Step_Rotation*(i-Start_Frame)+0.5,0)
Italic=trunc(Start_Italic+Step_Italic*(i-Start_Frame)+0.5,0)
Xdpi=trunc(Start_Xdpi+Step_Xdpi*(i-Start_Frame)+0.5,0)
Ydpi=trunc(Start_Ydpi+Step_Ydpi*(i-Start_Frame)+0.5,0)
Size=trunc(Start_Size+Step_Size*(i-Start_Frame)+0.5,0)
X=trunc(Start_X+Step_X*(i-Start_Frame)+0.5,0)
Y=trunc(Start_Y+Step_Y*(i-Start_Frame)+0.5,0)
IF OS=1 then DO
pp_EffectOn
pp_AirBrush Opacity Flow
END
ELSE DO
IF Dp=24 then DO
pp_BrushOpacity Opacity
END
ELSE DO
pp_EffectOn
pp_Trans Opacity
END
END
IF OXdpi=Xdpi&OYdpi=Ydpi&OItalic=Italic&ORotation=Rotation&OSize=Size then DO
pp_TextDraw X Y
END
ELSE DO
IF Opacity>0 then DO
pp_TextXDPI Xdpi
pp_TextYDPI Ydpi
pp_TextItalic Italic
pp_TextRotate Rotation
pp_TextSize Size
pp_TextMake
pp_TextDraw X Y
OXdpi=Xdpi
OYdpi=Ydpi
OItalic=Italic
ORotation=Rotation
OSize=Size
END
END
pp_EffectOff
END
IF Dp=24 then DO
pp_BrushOpacity 100
END
ELSE DO
pp_EffectOn
pp_Trans 100
END
pp_TextDraw X Y
pp_EffectOff
pp_TextRestore
pp_TextMake
pp_PermitRefresh