are Group Objects "hit testable"?

Hello!

I have a group which contains lots of inner display objects with gaps between them (because those objects have different sizes)

Now, I would like to drag the group as a whole.

If I touch any of the objects, everything works fine - but as soon as I touch a gap, the group does no longer get the touch event (unless I enter one of the inner objects while dragging)

I already tried to set “isHitTestable” to true, but that did not work.

Is there any other trick?

Thanks in advance for any help!

Andreas Rozek [import]uid: 4331 topic_id: 485 reply_id: 300485[/import]

Hopefully the Corona crew will have a better answer, but I had a similar problem and my workaround was to add a large rectangle to the group with the opacity set to .01 (making it invisible on my iTouch).

– Walt Sterdan [import]uid: 4329 topic_id: 485 reply_id: 939[/import]

I was just going to say "add a rectangle and make it transparent)… Walt beat me to it.

Otherwise, I would say, see if the event.x and event.y are inside of the group rectangle and if it is, then move the group.

C. [import]uid: 24 topic_id: 485 reply_id: 940[/import]

Walt and Carlos,

thanks for your answers - that would have been my workaround as well.

Walt: you set the opacity to 0.01 rather than 0? Will completely transparent objects miss events as well?

Thanks for your ideas!

Andreas Rozek [import]uid: 4331 topic_id: 485 reply_id: 942[/import]

Hi Andreas;

If I remember correctly, when I set the rectangle’s alpha to 0.0 it was no longer selectable; I tried a few low numbers and setting the alpha to 0.01 worked the best for me, though I didn’t test too extensively.

– Walt Sterdan [import]uid: 4329 topic_id: 485 reply_id: 943[/import]

Hi Walt,

that would fit to the description of “.isHitTestable” - although I thought that property would only become relevant when “.isVisible == false”.

Kind regards,

Andreas Rozek [import]uid: 4331 topic_id: 485 reply_id: 944[/import]