home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
circle
/
AnimStar.rx
< prev
next >
Wrap
Text File
|
1999-12-09
|
2KB
|
118 lines
/* Script Rexx
Make Anim_Star
*/
call addlib("rexxmathlib.library", 5, -30, 0)
options results
parse ARG Port x1 y1 r b
r2=r/3
Pi=3.1415926/180
ADDRESS COMMAND
sens=0
s0=3
if EXISTS('PerfectPaint:Prefs/Rexx_Prefs/AnimStar') THEN DO
IF OPEN('lfile','PerfectPaint:Prefs/Rexx_Prefs/AnimStar', "R") then DO
s0 = READLN('lfile')
sens = READLN('lfile')
CALL CLOSE('lfile')
END
END
ADDRESS value Port
pp_DialogInit 250 85 "*Anim*Star*" 2
pp_Integer 0 110 5 50 16 "Number*of*Point*" 1 s0
pp_Cycle 1 110 25 100 16 "Option" 1 "Filled|Unfilled" sens
pp_Dialog
rc=result
if rc=0 then
do
EXIT
end
pp_GetDialog 0
s0=result
pp_GetDialog 1
sens=result
CALL SavePrefs('AnimStar',s0,sens)
ADDRESS value Port
pp_CountFrames
nb=result
IF nb<2 then DO
pp_Warn 'Make*an*Anim*first.'
EXIT
END
a=360/s0
a2=a/2
DO j=0 to 89 by (90/nb)
co=Cos(j*Pi)
si=Sin(j*Pi)
pp_StartPoly
DO i=0 To 359 by a
xx = Sin(i*Pi)*r
yy = Cos(i*Pi)*r
x = xx*co-yy*si+x1
y = xx*si+yy*co+y1
ii=i+a2
xx = Sin(ii*Pi)*r2
yy = Cos(ii*Pi)*r2
x2 = xx*co-yy*si+x1
y2 = xx*si+yy*co+y1
ii=i-a2
xx = Sin(ii*Pi)*r2
yy = Cos(ii*Pi)*r2
x3 = xx*co-yy*si+x1
y3 = xx*si+yy*co+y1
pp_AddPoly trunc(x3) trunc(y3)
pp_AddPoly trunc(x) trunc(y)
pp_AddPoly trunc(x2) trunc(y2)
END
IF sens=1 then DO
pp_EndPoly
END
ELSE DO
pp_EndPolyF
END
pp_NextFrame
END
EXIT
SavePrefs: PROCEDURE
Prefname='PerfectPaint:Prefs/Rexx_Prefs/'||ARG(1)
if EXISTS(Prefname) THEN DO
ADDRESS COMMAND
'delete >nil: '||Prefname
END
IF OPEN('pfile',PrefName,'W') THEN DO
do i=2 to ARG()
CALL WRITELN('pfile',ARG(i))
end
CALL CLOSE('pfile')
RETURN