home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
bridge
/
Anim_Text.rx
< prev
next >
Wrap
Text File
|
2000-09-11
|
8KB
|
449 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_CountFrames
Total_Frame=result
Start_Frame=1
End_Frame=Total_Frame
if End_Frame<2 then do
pp_Warn 'Make*an*Anim*first.'
pp_PermitRefresh
EXIT
end
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
Start_Flow=0
End_Flow=0
Start_Opacity=100
End_Opacity=100
END
ELSE
DO
ADDRESS value Port
pp_Warn 'Make*a*Text*first.'
pp_PermitRefresh
EXIT
ADDRESS COMMAND
END
file="Ram:T/pp_move"
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')
Start_Flow=READLN('b')
End_Flow=READLN('b')
Start_Opacity=READLN('b')
End_Opacity=READLN('b')
CALL CLOSE('b')
END
R=-1
ADDRESS value Port
Path=0;Type=0
DO UNTIL R>-1
D.2='*Frame*(*#'||Start_Frame||'->#'||End_Frame||'*)*'
D.3='*Rotation*(*'||Start_Rotation||'*->*'||End_Rotation||'*)*'
D.4='*Italic*(*'||Start_Italic||'*->*'||End_Italic||'*)*'
D.5='*Size*(*'||Start_Size||'*->*'||End_Size||'*)*'
D.6='*ScaleX*(*'||Start_Xdpi||'*->*'||End_Xdpi||'*)*'
D.7='*ScaleY*(*'||Start_Ydpi||'*->*'||End_Ydpi||'*)*'
D.8='*Flow*(*'||Start_Flow||'*->*'||End_Flow||'*)*'
D.9='*Opacity*(*'||Start_Opacity||'*->*'||End_Opacity||'*)*'
pp_DialogInit 250 270 "*MOVE*" 10
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
j=55
DO i=2 to 9
pp_Button i 20 j 200 16 D.i
j=j+20
if i=2 then DO;j=j+10;END
if i=7 then DO;j=j+10;END
END
pp_Dialog
R=result
pp_GetDialog 0
Path=result
pp_GetDialog 1
Type=result
if R=-9 then DO
pp_DialogInit 150 80 "*OPACITY*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Opacity
pp_Integer 1 60 25 50 16 "End" 1 End_Opacity
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Opacity=result
pp_GetDialog 1
End_Opacity=result
END
END
if R=-8 then DO
pp_DialogInit 150 80 "*FLOW*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Flow
pp_Integer 1 60 25 50 16 "End" 1 End_Flow
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Flow=result
pp_GetDialog 1
End_Flow=result
END
END
if R=-5 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=-6 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=-7 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=-2 then DO
pp_DialogInit 150 80 "*FRAME*" 2
pp_Integer 0 60 5 50 16 "Start" 1 Start_Frame
pp_Integer 1 60 25 50 16 "End" 1 End_Frame
pp_Dialog
rc=result
IF rc=1 then DO
pp_GetDialog 0
Start_Frame=result
pp_GetDialog 1
End_Frame=result
IF End_Frame>Total_Frame THEN DO
End_Frame=Total_Frame
END
IF Start_Frame>End_Frame THEN DO
Start_Frame=1
END
END
END
if R=-3 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=-4 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_move'
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',Start_Flow)
CALL WRITELN('c',End_Flow)
CALL WRITELN('c',Start_Opacity)
CALL WRITELN('c',End_Opacity)
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_Flow=(End_Flow-Start_Flow)/Step
Step_Opacity=(End_Opacity-Start_Opacity)/Step
Step_X=(End_X-Start_X)/Step
Step_Y=(End_Y-Start_Y)/Step
DO i=Start_Frame to End_Frame
pp_GotoFrame i
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)
Flow=trunc(Start_Flow+Step_Flow*(i-Start_Frame)+0.5,0)
Opacity=trunc(Start_Opacity+Step_Opacity*(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 Flow>3 then DO
pp_EffectOn
pp_AirBrush Opacity Flow
END
ELSE
IF Opacity<100 then DO
IF Dp=24 then DO
pp_BrushOpacity Opacity
END
ELSE DO
pp_EffectOn
pp_Trans Opacity
END
END
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
END
pp_EffectOff
END
pp_GotoFrame Start_Frame
pp_TextRestore
pp_TextMake
pp_PermitRefresh