top of page

Octagon Drawing Example

This program draws various shapes on the Show page and is a good way of getting started with the drawing commands in Octagon.

Program


---

Octagon Drawing Program

---


prog_vars =


d/step 0

d/color 0

d/opacity 1.0

d/arc_angle 0

d/arc_radius 0

prog_vars.


prog_start =

pclear


ptl f a ^ts=20^tf=verdana^ "JackBord Oactagon Drawing Program"


psq t e 100 ^fc=red ^

pcr t h 50 ^fc=cyan ^


prect o j f e ^fc=yellow ^lc=yellow^lw=5^


prog_start.


prog_loop =

-- main program loop


repeat 35 ->

pal /step /step /step /step ^lc=/color ^op=/opacity ^lw=50^


mapi 0 520 0 360 /step -> /arc_angle

mapi 0 520 0 100 /step -> /arc_radius

parc 400 200 /arc_radius 0 /arc_angle ^lc=/color ^fc=transparent^lw=16^


inc /step 15

dec /opacity 0.05

any /opacity <= 0 -> /opacity 1.0


inc /color

any /color >= 15 -> /color 1


ptl t c "step /step"

repeat.


exitprog


prog_loop.



prog_stop =

print "Bye"

prog_stop.


bottom of page