StdDraw & Computer Animation

San Skulrattanakulchai

October 1, 2018

StdDraw

StdDraw, continued

Using StdDraw

StdDraw drawing functions

StdDraw drawing functions, continued

StdDraw non-drawing functions

Signature Purpose
setScale() sets x-scale and y-scale to default (between 0.0 and 1.0)
setScale(min: Double, max: Double) reset both x-range and y-range to (min, max)
setXscale(xmin: Double, xmax: Double) reset x-range to (xmin, xmax)
setYscale(ymin: Double, ymax: Double) reset y-range to (ymin, ymax)
clear() clears the screen to default color (white)
clear(color: java.awt.Color) clears the screen to specified color
enableDoubleBuffering() enable double buffering
disableDoubleBuffering() disable double buffering

Non-drawing functions, continued

Signature Purpose
setPenColor() sets pen color to default color (black)
setPenColor(color: java.awt.Color) sets pen color to specified color
setPenRadius() sets pen radius to default size (0.002)
setPenRadius(radius: Double) sets pen radius to spedified radius
pause(t: Int) pause for t milliseconds
show() copies offscreen buffer to onscreen buffer

Computer animation