Page 1 of 1

setobjectrect(object,rect[])

Posted: 22 Jan 2015 07:54
by Softcore
How long has it been there? Just noticed it yesterday!

Provided, that rect is an attribute that you can change with setattribute, why was it implemented? Just for ease of use? Am I missing something important here?

I also saw getobjectrect(object).....

Same questions apply. Of course I can see that now the basic function of getting the rect for a canvas object is now much more simplified with this function.

Re: setobjectrect(object,rect[])

Posted: 22 Jan 2015 08:25
by nick_liine
Been there since we introduced scripting in 2.0. It's a basic function for creating dynamic patches, moving/resizing objects. Welcome to the party. ;-)

Re: setobjectrect(object,rect[])

Posted: 22 Jan 2015 10:23
by Softcore
lol I feel stupid now! I was using setattribute for "rect" all this time! lol

Re: setobjectrect(object,rect[])

Posted: 22 Jan 2015 18:08
by Phil999
that was also used in the Canvas examples.

I think it doesn't matter what method we use, both do the same.

Re: setobjectrect(object,rect[])

Posted: 22 Jan 2015 18:27
by ndivuyo
Yea I was confused when I saw it in the canvas tutorials too. But hey, makes things easier!

Re: setobjectrect(object,rect[])

Posted: 23 Jan 2015 20:52
by Softcore
wth maybe I have an older version fo the canvas tutorials?

Eveywhere I looked there's a

decl c=getobject();
decl rect = getattribute(c, 'rect');

and this is why seeing the function in the "internal" folder confused me in the first place.

Re: setobjectrect(object,rect[])

Posted: 23 Jan 2015 23:47
by Phil999
sorry, I was unclear in my comment. I meant it the same way as you.

Re: setobjectrect(object,rect[])

Posted: 25 Jan 2015 22:52
by Softcore
Ah ok then! All good!