Mediascripting on the Web (CSC 195 2014F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [Teaching & Learning] - [Calendar]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference:
Related Courses: [2013S]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Overview
setup()
- size(width,height); also set state/globalsdraw()
- redraw the imagestroke(BW)
, stroke(R,G,B)
line(x0,y0,x1,y1)
fill(BW)
, fill(R,G,B)
ellipse(x,y,width,height)
, rect(x,y,width,height)
float foo;
float bar;
float c;
int width = 500;
int height = 300;
void
setup()
{
size(width,height);
foo = 300;
bar = 300;
c = 0;
}
void
draw()
{
foo = (foo + 5) % width;
bar = (bar - 2) % height;
c = (c+1) % 93;
colorMode(HSB,100);
fill(c,100,100);
strokeWeight(2);
stroke(c,100,100);
line(0,0,foo,bar);
line(50,50, 50,500);
ellipse(200,200,200,50);
rect(200,200,200,50);
} // draw
Your turn to play.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [Teaching & Learning] - [Calendar]
Current: [Outline] [EBoard] [Reading] [Lab] [Assignment]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Readings]
Reference:
Related Courses: [2013S]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker]
Copyright (c) 2014 Samuel A. Rebelsky.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.