Problem touch and drag a group...

I noticed when using a group with some objects in it and I want to touch and drag the whole group with an eventlistener “touch” the groups is only moving when the finger is above an object which is inside the group.

Shouldn’t the group move even, when the finger is placed outside an object BUT inside the groups boundaries?

Everytime the finger is placed on the transparent parts of the group the object can’t be moved.

Any help welcome!

hi, to my knowledge, a touch event is trigger by touching a display object.

assuming you need dynimcs in this, i have the following thoughts:

untested!!! (as in i am not sure touch works with displaygroups) : adding all objects to a single displaygroup and set the listener to the displaygroup itself could work, as a displaygroups size is basically the square size that best fits all included objects.

If that doesnt work, I’d probably include an invisible 10x10 pixels square png texture (for efficiency), and scale it to the size of the displaygroup. it will catch all touches and solve your issue.

hope it helps :slight_smile:

Anaqim

Why haven’t I thought of your last tip myself!? ;)… guess the alpha=0 was going through my head. Of course an empty image will solve this! :slight_smile:

Thank you so much for your help!!!

Glad to be of help :slight_smile: next time its my turn.

Dont forget to turn on isTouchEnabled (or something like that, not a good head for syntax)

hi, to my knowledge, a touch event is trigger by touching a display object.

assuming you need dynimcs in this, i have the following thoughts:

untested!!! (as in i am not sure touch works with displaygroups) : adding all objects to a single displaygroup and set the listener to the displaygroup itself could work, as a displaygroups size is basically the square size that best fits all included objects.

If that doesnt work, I’d probably include an invisible 10x10 pixels square png texture (for efficiency), and scale it to the size of the displaygroup. it will catch all touches and solve your issue.

hope it helps :slight_smile:

Anaqim

Why haven’t I thought of your last tip myself!? ;)… guess the alpha=0 was going through my head. Of course an empty image will solve this! :slight_smile:

Thank you so much for your help!!!

Glad to be of help :slight_smile: next time its my turn.

Dont forget to turn on isTouchEnabled (or something like that, not a good head for syntax)