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: FourthWorld, heatherlaine, Klaus, kevinmiller
-
richmond62
- Livecode Opensource Backer

- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Thu Nov 17, 2022 3:58 pm
-
Feeling stupid:
Code: Select all
on mouseDown
move me to the mouseLoc
end mouseDown
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10317
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Nov 17, 2022 6:23 pm
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

- Posts: 10317
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Nov 17, 2022 6:24 pm
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
Post
by M-A Kuttner » Thu Nov 17, 2022 7:01 pm
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.
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10317
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Thu Nov 17, 2022 7:19 pm
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

- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Thu Nov 17, 2022 8:27 pm
Because that was a 10 minute mental blip in the middle of some 9-10 year olds on-task . . .
-
richmond62
- Livecode Opensource Backer

- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Fri Nov 18, 2022 11:14 am
A pupil of mine stated that that would take at least 10-12 lines of C#.
-
dunbarx
- VIP Livecode Opensource Backer

- Posts: 10317
- Joined: Wed May 06, 2009 2:28 pm
Post
by dunbarx » Fri Nov 18, 2022 2:59 pm
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

- Posts: 10096
- Joined: Fri Feb 19, 2010 10:17 am
Post
by richmond62 » Fri Nov 18, 2022 7:11 pm
1 line of functional code.