Forums > Javascript

jsui problem

February 15, 2006 | 8:46 pm

hi!

i’m trying to move a jsui obkect around in a locked patcher.
but there are some strange things happening.

please try the following example.
(simply drag the jsui object when the patcher is locked.)

thank you so much!

max

///////////////////////////////////////////////////////////

autowatch = 1;

var bgc = [0, .1, .2, 1];
var linec = [.2, .7, 0, 1];
var px=0;
var py=0;
post("reloaded");
post();

sketch.default2d();
bang();
function bang()
{
draw();
refresh();
}

function draw()
{
with(sketch)
{
fsaa = 0;
fontsize = 8;
textalign("left", "top");
glclearcolor(bgc);
glclear();
glcolor(linec);
//lefttop=(screentoworld(0, 0));
//righttop=(screentoworld(size[0], 0));
leftbot=(screentoworld(0, size[1]-8));
moveto(leftbot);
text("test");
}
}

function ondrag (x, y, button, mod1, shift, caps, opt, mod2)
{

if(px==0&&py==0)
{
px = x;
py = y;
return;
}

deltax = x-px;
px = x;
deltay = y-py;
py = y;
o = this.box;
o.rect = [o.rect[0]+deltax, o.rect[1]+deltay, o.rect[2]+deltax,
o.rect[3]+deltay]
}

///////////////////////////////////////////////////////////


——————————————-
————–maximilian marcoll———–
———composition | performance———
——http://www.maximilianmarcoll.de —–
——————————————-


February 15, 2006 | 9:46 pm

Moving this thread to javascript-dev…


Viewing 2 posts - 1 through 2 (of 2 total)