Page 1 of 1

Hole in one

Posted: Thu Nov 17, 2022 3:58 pm
by richmond62
Screen Shot 2022-11-17 at 4.59.14 PM.png
-
Feeling stupid:

Code: Select all

on mouseDown
      move me to the mouseLoc
end mouseDown

Re: Hole in one

Posted: Thu Nov 17, 2022 6:23 pm
by dunbarx
Richmond.

Is that handler in the graphic itself? If so, it will only move its loc to the mouseLoc. Timing yet to be determined.

But is that what you had in mind? I assume that whatever method is best, it does not rely upon the user clicking within the rect of the actual target of interest.

Craig

Re: Hole in one

Posted: Thu Nov 17, 2022 6:24 pm
by dunbarx
Richmond.

Also, I think that the OP wants the target to track the mouse, not just sidle over to the clickloc.

Craig

Re: Hole in one

Posted: Thu Nov 17, 2022 7:01 pm
by M-A Kuttner
Maybe on mouseStillDown?

Re: Hole in one

Posted: Thu Nov 17, 2022 7:12 pm
by richmond62
I am the OP.

Re: Hole in one

Posted: Thu Nov 17, 2022 7:19 pm
by dunbarx
Why not mouseMove? A handler for that message in the card script can filter out unwanted controls, and tracks beautifully.

Craig

Re: Hole in one

Posted: Thu Nov 17, 2022 8:27 pm
by richmond62
Because that was a 10 minute mental blip in the middle of some 9-10 year olds on-task . . .

Re: Hole in one

Posted: Fri Nov 18, 2022 11:14 am
by richmond62
A pupil of mine stated that that would take at least 10-12 lines of C#.

Re: Hole in one

Posted: Fri Nov 18, 2022 2:59 pm
by dunbarx
Richmond.

Do you mean in comparison to:

Code: Select all

on mouseMove
  set the loc of img "hole" to the mouseLoc
end mouseMove.
Does that count as one line or three?

Craig

Re: Hole in one

Posted: Fri Nov 18, 2022 7:11 pm
by richmond62
1 line of functional code.