In GRAB control
Tore Nilsen
tore.nilsen at me.com
Sun Oct 15 14:47:14 EDT 2017
Try on mouseMove instead of on grab:
on mouseMove
if the mouse is down — to make sure you are holding on to something
your code goes here
end if
end mouseMove
Tore
> 15. okt. 2017 kl. 19:07 skrev Richmond Mathewson via use-livecode <use-livecode at lists.runrev.com>:
>
> If you try that "code snippet" I think you will get terribly stuck: that's a question.
>
> Richmond.
>
> On 10/15/17 8:04 pm, Tom Glod via use-livecode wrote:
>> richmond, are you asking a question or giving us code snippet to use?
>>
>> On Sun, Oct 15, 2017 at 1:01 PM, Richmond Mathewson via use-livecode <
>> use-livecode at lists.runrev.com> wrote:
>>
>>> Imagine a stack with a picture of an orange in its centre . . .
>>>
>>> The picture: img "arancia", contains the following script:
>>>
>>> on mouseDown
>>> grab me
>>> end mouseDown
>>>
>>> so the end-user can move the picture wherever they want
>>> all over the stack.
>>>
>>> HOWEVER . . . I want to know whether their initial movement is to the
>>> left, right, upwards or downwards.
>>>
>>> Fantasy time again [pseudocode]:
>>>
>>> on Grab
>>> put the left of me into LEFT1
>>> put the top of me into TOP1
>>> wait 2 ticks
>>> put the left of me into LEFT2
>>> put the top of me into TOP2
>>> if LEFT2 < LEFT1 then
>>> put "LEFT"
>>> else
>>> put "RIGHT"
>>> end if
>>> if TOP2 < TOP1 then
>>> put "UP"
>>> else
>>> put "DOWN"
>>> end if
>>> end Grab
>>>
>>> Richmond.
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://post.spmailt.com/f/a/3dHp0NbbW6l-hhVAqUqAVQ~~/AAGp3AA~/RgRbxMirP0EIACzw8z9Dj9ZXA3NwY1gEAAAAAFkGc2hhcmVkYQdoZWxsb18xYAw1Mi4zOS4yNi4xNDRCCgAAK5XjWWizsdtSHXVzZS1saXZlY29kZUBsaXN0cy5ydW5yZXYuY29tCVEEAAAAAEQ1aHR0cDovL2xpc3RzLnJ1bnJldi5jb20vbWFpbG1hbi9saXN0aW5mby91c2UtbGl2ZWNvZGVHAnt9
>>>
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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