mirror of
https://github.com/dyne/FreeJ.git
synced 2026-02-05 12:39:15 +01:00
processing-js 0.4 has been merged in some relevant parts basic and topic scripts added for test color handling fixed, more scripts show up now
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
// Sets the screen to be 200, 200, so the width of the window is 200 pixels
|
|
// and the height of the window is 200 pixels
|
|
size(200, 200);
|
|
background(0);
|
|
noFill();
|
|
stroke(255);
|
|
|
|
// The two parameters of the point() method each specify coordinates.
|
|
// This call to point() draws at the position [100, 100]
|
|
point(width/2, height/2);
|
|
|
|
// Draws to the position [100, 50]
|
|
point(width/2, height/4);
|
|
|
|
// It is also possible to specify a point with any parameter,
|
|
// but only coordinates on the screen are visible
|
|
point(60, 30);
|
|
point(60, 134);
|
|
point(160, 50);
|
|
point(280, -800);
|
|
point(201, 100);
|
|
|
|
// Coordinates are used for drawing all shapes, not just points.
|
|
// Parameters for different methods are used for different purposes.
|
|
// For example, the first two parameters to line() specify the coordinates of the
|
|
// first point and the second two parameters specify the second point
|
|
stroke(204);
|
|
line(0, 73, width, 73);
|
|
|
|
// The first two parameters to rect() are coordinates
|
|
// and the second two are the width and height
|
|
rect(110, 55, 40, 36);
|