cumbersome pt and rect operations
prothero at earthednet.org
Thu May 15 19:21:41 EDT 2014
Tnx for the hint. But, I am doing a lot of adding points and putting various vertices of rects at specific points. and it occurred to me that just being able to add points to get the resultant point and that adding a point to a rect could move the rect by the amount of the point, and having various intersection and other routines would be extremely handy. For example, if I want to add two points together, it’s:
put item 1 of pt1 + item 1 of pt2 into item 1 of pt3
put item 2 of pt1 + item 2 of pt2 into item 2 of pt3
For positioning rects, it’s even more cumbersome, and takes 4 statements.
Of course, I have a bunch of basic handlers in a library that I use to do this, but some of the long, verbose way of moving things does seem quite cumbersome. I’m not doing animation, just setting up data plots.
On May 15, 2014, at 2:12 PM, Devin Asay <devin_asay at byu.edu> wrote:
> On May 15, 2014, at 2:28 PM, William Prothero <prothero at earthednet.org>
>> I’m doing a lot of moving objects around on the screen. I find that it’s super cumbersome and generates a load of code. It would be really nice if there could be more compact operations.
>> For example:
>> put pt1 + pt2 into sumofPts
>> 2,3 + 5,6 would result in 7,9
>> put rect1 + pt1 into aRect
>> 2,4,6,9 + 3,4 would result in 5,8,9,13
>> This would make it much easier to do these move operations.
>> I know these can be done with simple functions but …..
>> Perhaps I’m missing something in the docs, and there’s a much easier way to do this.
> I don't know exactly what you want to do, but you can do a relative move by just specifying the X and Y increments that you want to add to the current location.
> move button "foo" relative 5,6 in 1 millisecond
> If you want instantaneous move you could try a 0 value for the time.
> Devin Asay
> Learn to code with LiveCode University
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the Use-livecode