multitouch drag groups

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

multitouch drag groups

Post by maxs » Sun Jan 01, 2012 9:12 am

OK Im trying to drag 2 groups objects to collide using multitouch. But this code appears to select only individual objects.
Can I drag 2 grouped objects at a time?

on touchmove pObjectID, pX,pY
set the location of the target to pX,pY
end touchmove

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: multitouch drag groups

Post by maxs » Fri Jan 06, 2012 5:14 am

Hi, Im using a mousestilldown handler to drag grouped object.. Sometimes the drag freezes up, yet I can still click and use the other buttons. Restarting the app will start allowing the dragging to continue.

DO I need to change to a touchmove command to fix this problem? If that is the case, am I able to drag an entire group? When I tested it, I could only drag single objects within the group.

Here is the code I am using:
on mousestilldown
set the loc of grp "Dragball1" of grp "3balls" to the mouseloc
end mousestillDown

Thank you, Max

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: multitouch drag groups

Post by jmburnod » Fri Jan 06, 2012 1:53 pm

Hi Max,
I think you can use

Code: Select all

on touchmove pTouchID,x,y
   put the owner of the target into tGroup
   set the loc of group tGroup to x,y
end touchmove
check "owner" in LC Dictionary

Best regards
Jean-Marc
https://alternatic.ch

maxs
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 421
Joined: Sat Jun 24, 2006 12:02 am
Contact:

Re: multitouch drag groups

Post by maxs » Sat Jan 07, 2012 6:18 am

ThANKS Jean Mark,

This may be exactly what I need. I'll try it.

Max

Post Reply