JavaScript Drawing Programmer
Here is the Draw Surface:
Usage: All these commands have to be typed into the web console of your browser. How to open the Web Console?
- To draw a line, type: drawline(x_start, y_start, x_end, y_end);
Example: drawline(100,50,100,100);
- To draw a bar, type: drawbar(x, y, width, height);
Example: drawbar(20, 80, 40, 40);
- To write some text, type: drawtext(x, y, text);
Example: drawtext(40, 40, "Hello World");
- You can also draw a circle with drawcircle(x, y, radius); or a square with drawsquare(x, y, size);
- To color things up you can add a color to any of these functions:
Example: drawtext(60, 60, "Hello User", "red");
- To clear the draw area type drawclear();
Code Examples:
i=0;
while(i<100){ drawbar(Math.random()*400, Math.random()*200, 10, 10, "blue"); i=i+1; }
i=0;
while(i<200){ drawline(0, i, 200-i, 0, "rgb(255,0,0)"); i=i+10; }
drawtext(200, 100, "This is Random","green");