BIT-101 [2003-2017]

Linescapes Iteration 2


Draw a bunch of lines.

[php lang=“JavaScript”]$(function() {
var canvas, context, width, height;

canvas = $("#canvas").get(0);
context = canvas.getContext(“2d”);
width = canvas.width;
height = canvas.height;

for(var y = 0; y < height; y += 10) { context.beginPath(); context.moveTo(0, y); context.lineTo(width, y); context.stroke(); } });[/php] Result.

« Previous Post
Next Post »