moving bpatcher with js in presentation mode

Jun 28, 2010 at 9:30am

moving bpatcher with js in presentation mode

I can’t seem to find the way to move / resize bpatcher in presentation mode. It has writable .rect property, but writing to it changes its patching place/size. May be I grab the wrong object though. My approach is to give scripting name to a bpatcher then find it with this.patcher.getnamed("name"). I know that with [thispatcher] I can send messages either to patch inside bpatcher or to bpatcher’s “box” and I could move it then (by talking to the box). Is there a way to achieve the same in javascript?

#51090
Jun 28, 2010 at 9:49am

ah, found it:

this.patcher.script("sendbox",varname,"presentation_rect",x,y,w,h);
#183290
Jun 28, 2010 at 11:12pm

I’m fairly sure you can use presentation “size” and “position” (or “pos”) from within javascript if you only want to change one or the other and not specify both, if it helps.

lh

#183291
Jul 7, 2010 at 4:52pm

that’s right:

this.patcher.script("sendbox",varname,"presentation_size",w,h);
this.patcher.script("sendbox",varname,"presentation_pos",x,y);

both work. What I was looking for (and found) was the way to address [bpatcher]‘s box instead of its contained patch.

#183292

You must be logged in to reply to this topic.