graphicsAddTest.frink

View or download graphicsAddTest.frink in plain text format

xc = -9
yc = 1

// Create a second graphic (a filled and outlined circle.)
g2 = new graphics
g2.stroke[.1]
g2.color[1,1,0]
g2.fillEllipseCenter[-10,-3.3,2,2]
g2.color[0,.5,0]
g2.drawEllipseCenter[-10,-3.3,2,2]
g2.stroke[.05]
g2.line[-10.5,-3.1,-9.5,-3.1]
g2.fillEllipseCenter[-10.3, -3.7, .3, .3]
g2.fillEllipseCenter[-9.7, -3.7, .3, .3]

//g.add[g2]

a = new Animation[1/30 s]
var g

for angle = 0 to 351 degrees step 10 degrees
{
   g = new graphics
   g.drawRectCenter[xc,yc,2.5,2.5]
   g.color[0,0,1]
   g.addCenterRotate[g2, xc+1/2, yc+1/2, 1, 1, angle]      // Bottom right
   g.addSizeRotate[g2, xc-1, yc, 1, 1, -angle]              // Bottom left
   g.addSidesRotate[g2, xc-1, yc-1, xc, yc, 2 angle]   // Top left
   g.addCenterRotate[g2, xc+1/2, yc-1/2, 1/2, 1, angle, false] // Top right, squished.

   a.add[g]
}
a.write["gadd.gif", 500, 500]
browse["gadd.gif"]

g.show[]
g.write["gadd.png", 500, 500]
g.write["gadd.jpg", 500, 500]
g.write["gadd.html", 500, 500]
g.write["gadd.svg", 500, 500]


View or download graphicsAddTest.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 17835 days, 15 hours, 37 minutes ago.