|
Author |
Topic: Quick Bits : STATIC FORM - 1 (Read 2790 times) |
|
arielm
|
Quick Bits : STATIC FORM - 1
« on: Mar 2nd, 2004, 10:38pm » |
|
SF1_001 Code:// drawing statements and execution flow, part I line(20, 20, 80, 80); rect(40, 50, 30, 25); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #1 on: Mar 2nd, 2004, 10:39pm » |
|
SF1_002 Code:// drawing statements and execution flow, part II // the statements order has been inversed, thus the line is now drawn over the rectangle rect(40, 50, 30, 25); line(20, 20, 80, 80); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #2 on: Mar 2nd, 2004, 10:40pm » |
|
SF1_003 Code:// setting the background color, using RGB values background(255, 255, 0); // yellow line(20, 20, 80, 80); rect(40, 50, 30, 25); |
|
|
« Last Edit: Mar 2nd, 2004, 10:43pm by arielm » |
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #3 on: Mar 2nd, 2004, 10:40pm » |
|
SF1_004 Code:// setting the background color, using one grayscale value background(127); // 50% gray line(20, 20, 80, 80); rect(40, 50, 30, 25); |
|
|
« Last Edit: Mar 2nd, 2004, 10:43pm by arielm » |
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #4 on: Mar 2nd, 2004, 10:42pm » |
|
SF1_005 Code:// demonstrating the use of stroke and fill background(240); // light gray stroke(255, 102, 0); // orange line(20, 20, 80, 80); fill(255, 255, 0); // yellow rect(40, 50, 30, 25); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #5 on: Mar 2nd, 2004, 10:44pm » |
|
SF1_006 Code:// demonstrating the use of noStroke background(240); stroke(255, 102, 0); line(20, 20, 80, 80); noStroke(); fill(255, 255, 0); rect(40, 50, 30, 30); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #6 on: Mar 2nd, 2004, 10:47pm » |
|
SF1_007 Code:// demonstrating the use of noFill background(240); // light gray color stroke(255, 102, 0); // outlines will be drawn in orange color // it will be used as the default outline drawing color, // until another "stroke" statement is encountered line(20, 20, 80, 80); noFill(); // rectangles drawn from now won't be filled with color, // until a "fill" statement is encountered rect(40, 50, 30, 30); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #7 on: Mar 2nd, 2004, 10:48pm » |
|
SF1_008 Code:// introducing additional drawing primitives fill(255, 204, 0); // orange fill triangle(20, 20, 10, 40, 30, 40); ellipse(0, 0, 20, 20); fill(255, 255, 0); // yellow fill triangle(50, 45, 50, 65, 90, 55); ellipse(40, 75, 40, 20); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
arielm
|
Re: Quick Bits : STATIC FORM - 1
« Reply #8 on: Mar 2nd, 2004, 10:50pm » |
|
SF1_009 Code:// demonstrating the use of rectMode and ellipseMode fill(255, 204, 0); // orange ellipse(0, 0, 20, 20); fill(255, 255, 0); // yellow ellipseMode(CENTER_RADIUS); // from now on, ellipses will be drawn from the center ellipse(50, 50, 20, 20); fill(255, 0, 0); // red rect(0, 0, 10, 10); fill(102); // dark grey rectMode(CENTER_RADIUS); // from now on, rectangles will also be drawn from the center rect(50, 50, 10, 10); |
|
|
Ariel Malka | www.chronotext.org
|
|
|
elout
|
Re: Quick Bits : STATIC FORM - 1
« Reply #9 on: Mar 21st, 2004, 10:48pm » |
|
..something basic ? If you want to draw graphics on a computer. You have to know that that the computerscreen consist of little squares, and these basic screen elements are called 'pixels'. Those pixels on your screen, have an x and an y postition. And numbers/position of all the pixels, mostly start from top-left in your screen/window. So you can draw a line from top-left (0,0) //x,y to another point on the screen. like (70,20) //x,y using; line(0, 0, 70, 20);
|
« Last Edit: Mar 21st, 2004, 10:49pm by elout » |
|
|
|
|
|