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

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -