SUB GDK_Triangle
(x1%
, y1%
, x2%
, y2%
, x3%
, y3%
, CLR&
) LINE (x1%
, y1%
)-(x2%
, y2%
), CLR&
LINE (x1%
, y1%
)-(x3%
, y3%
), CLR&
LINE (x2%
, y2%
)-(x3%
, y3%
), CLR&
SUB GDK_TriangleFill
(x1%
, y1%
, x2%
, y2%
, x3%
, y3%
, CLR&
, FillCLR&
) LINE (x1%
, y1%
)-(x2%
, y2%
), CLR&
LINE (x1%
, y1%
)-(x3%
, y3%
), CLR&
LINE (x2%
, y2%
)-(x3%
, y3%
), CLR&
paintx% = (x1% + x2% + x3%) / 3
painty% = (y1% + y2% + y3%) / 3
PAINT (paintx%
, painty%
), FillCLR&
, CLR&
SUB GDK_Ellipse
(X%
, Y%
, XRadius!
, YRadius!
, CLR&
) IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
SUB GDK_EllipseFill
(X%
, Y%
, XRadius!
, YRadius!
, CLR&
, FillCLR&
) IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
PAINT (X%
, Y%
), FillCLR&
, CLR&
SUB GDK_EllipseSegment
(X%
, Y%
, XRadius!
, YRadius!
, Start!
, End!
, CLR&
) Firstloop% = 0
IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
Firstloop% = 1
PSET (pointx%
, pointy%
), CLR&
LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
SUB GDK_EllipseSegmentFill
(X%
, Y%
, XRadius!
, YRadius!
, Start!
, End!
, CLR&
, FillClr&
) Firstloop% = 0
IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) Firstloopxy(0) = pointx%
Firstloopxy(1) = pointy%
LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
Firstloop% = 1
PSET (pointx%
, pointy%
), CLR&
LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
))paintx% = (X% + Firstloopxy(0) + pointx%) / 3
painty% = (Y% + Firstloopxy(1) + pointy%) / 3
PAINT (paintx%
, painty%
), FillClr&
, CLR&
SUB GDK_Circle
(X%
, Y%
, Radius!
, CLR&
) MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
SUB GDK_CircleFill
(X%
, Y%
, Radius!
, CLR&
, FillCLR&
) MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
PAINT (X%
, Y%
), FillCLR&
, CLR&
SUB GDK_CircleSegment
(X%
, Y%
, Radius!
, CLR&
, CircleStart!
, CircleEnd!
) Firstloop% = 0
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
FOR i
= CircleStart!
TO CircleEnd!
STEP MinStep!
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
Firstloop% = 1
PSET (pointx%
, pointy%
), CLR&
LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
SUB GDK_CircleSegmentFill
(X%
, Y%
, Radius!
, CLR&
, FillClr&
, CircleStart!
, CircleEnd!
) Firstloop% = 0
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
FOR i
= CircleStart!
TO CircleEnd!
STEP MinStep!
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
Firstloopxy(0) = pointx%
Firstloopxy(1) = pointy%
Firstloop% = 1
PSET (pointx%
, pointy%
), CLR&
LINE (X%
, Y%
)-(pointx%
, pointy%
), CLR&
IF CircleEnd!
- CircleStart!
> 4 * ATN(1) THEN i = (CircleEnd! / 4)
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
))paintx% = (X% + Firstloopxy(0) + pointx%) / 3
painty% = (Y% + Firstloopxy(1) + pointy%) / 3
PAINT (paintx%
, painty%
), FillClr&
, CLR&
SUB GDK_Line
(X%
, Y%
, XX%
, YY%
, CLR&
, WIDTH%
) FOR offset
= -(WIDTH%
/ 2) TO WIDTH%
/ 2 LINE (X%
, Y%
+ offset
)-(XX%
, YY%
+ offset
), CLR&
FOR offset
= -((WIDTH%
+ 1) / 2) TO (WIDTH%
+ 1) / 2 LINE (X%
, Y%
+ offset
)-(XX%
, YY%
+ offset
), CLR&
SUB GDK_LineAngle
(X%
, Y%
, Angle!
, Length!
, CLR&
) x2%
= X%
+ (Length!
* COS(Angle!
))y2%
= Y%
+ (Length!
* SIN(Angle!
))LINE (X%
, Y%
)-(x2%
, y2%
), CLR&
SUB GDK_LineH
(X%
, XX%
, Y%
, CLR&
, WIDTH%
) FOR offset
= -(WIDTH%
/ 2) TO WIDTH%
/ 2 LINE (X%
, Y%
+ offset
)-(XX%
, Y%
+ offset
), CLR&
FOR offset
= -((WIDTH%
+ 1) / 2) TO (WIDTH%
- 1) / 2 LINE (X%
, Y%
+ offset
)-(XX%
, Y%
+ offset
), CLR&
SUB GDK_LineV
(Y%
, YY%
, X%
, CLR&
, WIDTH%
) FOR offset
= -(WIDTH%
/ 2) TO WIDTH%
/ 2 LINE (X%
+ offset
, Y%
)-(X%
+ offset
, YY%
), CLR&
FOR offset
= -((WIDTH%
+ 1) / 2) TO (WIDTH%
- 1) / 2 LINE (X%
+ offset
, Y%
)-(X%
+ offset
, YY%
), CLR&
SUB GDK_Box
(X%
, Y%
, Width%
, Height%
, CLR&
) LINE (X%
, Y%
)-(X%
+ Width%
, Y%
+ Height%
), CLR&
, B
SUB GDK_BoxFill
(X%
, Y%
, Width%
, Height%
, CLR&
, FillCLR&
) LINE (X%
, Y%
)-(X%
+ Width%
, Y%
+ Height%
), CLR&
, B
PAINT (X%
+ 2, Y%
+ 2), FillCLR&
, CLR&
SUB GDK_BoxXS
(X%
, Y%
, Width%
, Height%
, XWidth%
, CLR&
, ShadeClr&
) Oldclr& = CLR&
FOR j%
= 0 TO XWidth%
- 1 CLR&
= _RGB(newred&
, newgreen&
, newblue&
) LINE (X%
- j%
, Y%
- j%
)-(X%
+ Width%
+ j%
, Y%
+ Height%
+ j%
), CLR&
, B
CLR& = Oldclr&
SUB GDK_EllipseXS
(X%
, Y%
, XRadius!
, YRadius!
, CLR&
, Width%
, ShadeClr&
) CLR&
= _RGB(newred&
, newgreen&
, newblue&
) IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
XRadius! = XRadius! + 1
YRadius! = YRadius! + 1
SUB GDK_CircleXS
(X%
, Y%
, Radius!
, CLR&
, Width%
, ShadeClr&
) OldClr& = CLR&
CLR&
= _RGB(newred&
, newgreen&
, newblue&
) MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
Radius! = Radius! + 1
CLR& = OldClr&
SUB GDK_EllipseX
(X%
, Y%
, XRadius!
, YRadius!
, CLR&
, Width%
) IF XRadius!
> YRadius!
THEN Radius!
= XRadius!
ELSE Radius!
= YRadius!
MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (XRadius!
* COS(i
)) pointy%
= Y%
+ (YRadius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
XRadius! = XRadius! + 1
YRadius! = YRadius! + 1
SUB GDK_CircleX
(X%
, Y%
, Radius!
, CLR&
, Width%
) MinStep! = 1 / (2 * 3.1415926535 * Radius!)
pointx%
= X%
+ (Radius!
* COS(i
)) pointy%
= Y%
+ (Radius!
* SIN(i
)) PSET (pointx%
, pointy%
), CLR&
Radius! = Radius! + 1