Linescapes Iteration 1

Draw a line.

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

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

context.beginPath();
context.moveTo(0, height / 2);
context.lineTo(width, height / 2);
context.stroke();
});[/php]

Result.

This entry was posted in JavaScript. Bookmark the permalink.

4 Responses to Linescapes Iteration 1

  1. Björn says:

    What a mysterious post. Would you care to elaborate on the purpose besides drawing a horizontal line? (or am I missing something here?)

  2. Björn says:

    Ok ok, I’ll be patient and wait for future iterations 🙂

  3. rmri says:

    I got some guesses but don’t want to spoil it 🙂

Leave a Reply