Moving an object in presentation mode

Mar 16, 2013 at 8:46am

Moving an object in presentation mode

Hi, i’m playing around with moving objects at the moment…

I can quite happily use the rect property of a MaxObj to set the location in a patcher, but this has no effect if the patcher is in presentation mode…
Is there a different call to make?

thx Lee

#67118
Mar 16, 2013 at 9:56am

Yes, there are different messages: ‘patching_rect’ and ‘presentation_rect’.

In the inspector click the attribute button @ (bottom left) to see the message names.

#241500
Mar 16, 2013 at 10:09am

Hi, thx for reply – that’s a really useful thing to know – never clicked that before :)

Still having issues tho: This is a snippet of the code:

var selector = this.patcher.parentpatcher.getnamed( ‘track_selector’ );

trace( “parent: ” + this.patcher.parentpatcher.name );

if ( selector ) {
trace( “selector: ” + selector.varname );

trace( “location: ” + selector.rect );

var loc = selector.rect;

loc[ 0 ] += flag ? 100 : -100;
loc[ 2 ] += flag ? 100 : -100;

selector.rect = loc;

trace( “newloc1: ” + loc );
trace( “newloc2: ” + selector.rect );
}

This works fine to move an object in the patcher, even tho I’m using rect and not patcher_rect… if i try replacing rect with patcher_rect or presentation_rect then I just get errors….

The varname returns the expected value…

#241501
Mar 17, 2013 at 8:01am

I’ve played around a bit more and the above code works with presentation_rect for objects that aren’t bpatchers, could this be a bug? If i can change the position of objects using this method, I would expect it to work on a bpatcher also….??

#241502

You must be logged in to reply to this topic.