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

C# random value from dictionary and tuple -

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

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -