XML Feeds

.

[javascript-dev] Re: Re: Strange "undefined" problem using screentoworld...

Emmanuel Jourdan c74-mailinglists at e--j.com
Mon May 19 11:34:50 MDT 2008


On 19 mai 08, at 19:16, Anthony Palomba wrote:

> Okay here is an example...
>
> test.pat...
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 320 91 39 9109513 random;
> #P message 240 91 55 9109513 not_correct;
> #P user jsui 240 137 64 64 1 0 0 test.js;
> #P message 182 91 37 9109513 correct;
> #P connect 3 0 1 0;
> #P connect 2 0 1 0;
> #P connect 0 0 1 0;
> #P window clipboard copycount 4;

sketch.screentoworld() returns an array, where the first item is x, y  
is the second, … and z the third. So you should do something like that:

wxyz = sketch.screentoworld(100/2,100/2);	
NodeList[0].x = wxyz[0];
NodeList[0].y = wxyz[1];
NodeList[0].z = wxyz[2];

HTH,
ej





More information about the javascript-dev mailing list