[beginner] x,y coordinates in LiveCode

Shawn Blc shawnlivecode at gmail.com
Sat Jan 10 15:05:27 EST 2015


Using the code for my menu it looks good, but I can easily confuse LC by
clicking fast, sometimes two buttons will move, other times three.  Most of
the time all four buttons will drop (correctly), but like I said, by
clicking fast I can easily confuse LC.

On Sat, Jan 10, 2015 at 2:02 PM, Shawn Blc <shawnlivecode at gmail.com> wrote:

> Thanks.  Colin I used your idea, then Richards.  Both work!  Here's what I
> ended up with.
>
> *on* mouseMove x,y
>
>    *put* "Object: "& the name of the target && the loc of the target &\
>
>       cr&"Mouse: "& x,y into fld "lblLocation"
>
> *end* mouseMove
>
>
> I'm doing not anything ground-breaking here.  Just trying to get a some
> what good looking menu system.
>
> Here's what I have:
>
>
> *on* mouseUp
>
>    *move* btn "btnA" to 95,102
>
>    *move* btn "btnB" to 95,130
>
>    *move* btn "btnC" to 95,158
>
>    *move* btn "btnD" to 95,186
>
>    *wait* until the mouse is up
>
> *end* mouseUp
>
>
> *on* mouseDoubleUp
>
>    *move* btn "btnA" to 90,72
>
>    *move* btn "btnB" to 90,72
>
>    *move* btn "btnC" to 90,72
>
>    *move* btn "btnD" to 90,72
>
>    *wait* until the mouse is up
>
> *end* mouseDoubleUp
>
>
>
>
> On Sat, Jan 10, 2015 at 11:58 AM, Richard Gaskin <
> ambassador at fourthworld.com> wrote:
>
>> Colin Holgate wrote:
>> > I suggested. One slight difference is that I tested mine first,
>> > and discovered that mousewithin doesn’t work as a card script,
>> > at least not on its own. Reading the dictionary it seems that
>> > a mousewithin handler has to be inside the object itself.
>>
>> Coordinates are a good opportunity to take advantage of something we have
>> in LiveCode that we only dreamed about in HC: mouseMove.
>>
>> It's a good fit here because it's always sent when the mouse is in
>> motion, and not sent when at rest which is nice since at those moments it's
>> not needed.
>>
>> on mouseMove x,y
>>    put "Object: "& the name of the target && the loc of the target &\
>>       cr&"Mouse: "& x,y
>> end mouseMove
>>
>>
>> --
>>  Richard Gaskin
>>  Fourth World Systems
>>  Software Design and Development for the Desktop, Mobile, and the Web
>>  ____________________________________________________________________
>>  Ambassador at FourthWorld.com                http://www.FourthWorld.com
>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>



More information about the Use-livecode mailing list