Download Introduction to Programming in Turing First Edition
Transcript
Chapter 8 : Pixel Graphics
153
% Plots magenta circles of ever increasing radius centered
% in window until the edge of the window is reached
setscreen ("graphics")
const centerx := maxx div 2
const centery := maxy div 2
for radius : 1 .. centery
drawoval (centerx, centery, radius, radius, magenta)
end for
In Turing, the predefined procedure drawfilloval draws a filled
oval without the necessity of using drawfill. It has the form
drawfilloval (x, y, xRadius, yRadius, c)
and causes an oval to be drawn and filled with color c.
8.6
Animation
The effect of animation can be achieved with the Pow
program by erasing each circle after a delay before plotting the
next circle. To erase a circle you can re-plot it using the
background color, number 0. The predefined procedure delay can
be called to waste time between the plot of each circle in magenta
and the plot of the same circle in black. It has the form
delay (duration)
where the duration is in milliseconds. The Pow program can thus
be changed to the Ripple program in which a ripple starting at the
center of the window appears to move out, by adding the two
statements
delay (500) % Delay half a second
drawoval (centerx, centery, radius, radius, 0)
after the drawoval that produces the magenta circle. This method
of animation can be used for any simple form like a dot, line, box,
or oval.
Related documents
R300 User guide
Sony Ericsson R306 User Guide
Tannoy T303 Cell Phone User Manual
Sony Spiro W100i 90g Black
Deutsche Telekom Sony Ericsson Spiro W100i, TMO XTRA 2.2" 90g Green, White
DFI CM64-AL User`s manual
English - Insignia
Check-In User Manual Ver 3
A711 PRINTER SERIES REFERENCES NSKGG**** USER MANUAL
Check-In Station User Manual
TRITON 60 SERIES 60 mm MINI-KIOSK USER MANUAL
SDS Landval User Manual V710