Hole in one

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Hole in one

Post 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Hole in one

Post 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
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Hole in one

Post by dunbarx »

Richmond.

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

Craig
M-A Kuttner
Posts: 50
Joined: Mon Apr 03, 2017 3:55 pm

Re: Hole in one

Post by M-A Kuttner »

Maybe on mouseStillDown?
Hypertalk developer on and off since the days of SuperCard. Currently using LC to do rapid prototyping for a new kids' toy.
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Hole in one

Post by richmond62 »

I am the OP.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Hole in one

Post by dunbarx »

Why not mouseMove? A handler for that message in the card script can filter out unwanted controls, and tracks beautifully.

Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Hole in one

Post by richmond62 »

Because that was a 10 minute mental blip in the middle of some 9-10 year olds on-task . . .
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Hole in one

Post by richmond62 »

A pupil of mine stated that that would take at least 10-12 lines of C#.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10507
Joined: Wed May 06, 2009 2:28 pm

Re: Hole in one

Post 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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10428
Joined: Fri Feb 19, 2010 10:17 am

Re: Hole in one

Post by richmond62 »

1 line of functional code.
Post Reply