Quantcast
Channel: simonsarris - Latest Comments
Viewing all articles
Browse latest Browse all 193

Re: A Gentle Introduction to Making HTML5 Canvas Interactive

$
0
0

Try instead:

var foo = new Shape(40,40,50,50);
s.addShape(foo);
alert(foo.x);

...alternatively, the code you posted should work if you rewrite addShape as such:

CanvasState.prototype.addShape = function(shape) {
    // current addShape code here
    return shape;
}

...but that's most likely not the best implementation strategy.


Viewing all articles
Browse latest Browse all 193

Trending Articles