Page 1 of 1

What exactly is the rect used for?

Posted: Thu Jul 17, 2014 3:32 pm
by jalz
Hi All,

Just a general query, nothing code specific but a concept to help me understand further. I notice there is a lot of reference to rect, (rectangle) when programming in LiveCode as well as other languages. What is the whole point of the rect, is it to do with screen size or the object size? When I was playing data grids, I noticed the rect used in the code. It seems like its a commonly frequently used command but I don't understand the significance, perhaps I'm just overthinking things as usual.

Sorry for the duh question, just wanted to get the term clear in my head and what it can be potentially used for (I've seen it in printing etc - so is it the viewport of an object/card etc?).

Thanks

Jalz

Re: What exactly is the rect used for?

Posted: Thu Jul 17, 2014 3:44 pm
by Klaus
Hi jalz,
jalz wrote:... perhaps I'm just overthinking things as usual.
yep, sounds like! :D

"The rect" of an object simply describes the (rectangular) area occupied by an LC object on the card and/or monitor!
Nothing mysterious, nothing special, nothing to see here, please pass on... 8)


Best

Klaus

Re: What exactly is the rect used for?

Posted: Thu Jul 17, 2014 3:49 pm
by jalz
OK - I gotta stop overcomplicating things, just me being daft - :oops:

Re: What exactly is the rect used for?

Posted: Thu Jul 17, 2014 6:28 pm
by Klaus
jalz wrote:... just me being daft - :oops:
Don't worry, others have made a whole career out of this misery:
http://www.youtube.com/watch?v=h5EofwRzit0 :D

Re: What exactly is the rect used for?

Posted: Thu Jul 17, 2014 6:31 pm
by dunbarx
Don't be daft, do this instead:

Make two buttons and place them anywhere on a new card. Do this in the msg box:

set the left of btn 2 to item 1 of the rect of btn 1.

The possibilities are endless...

Craig Newman