bonsaijs - Accessing the position of simple shapes -
i have rect
assigned variable myrect:
var myrect = new rect (250,0,20,200);
i thought writing:
console.log(myrect.x);
would output 250 but, says "undefined".
i know how can redraw rectangle performing arithmetic on x , y coordinates.
the way access x , y properties through attr()
method.
console.log(myrect.attr('x'));
see in documentation. have admit, documentation isn't beginner-friendly yet.
Comments
Post a Comment