Can I use object.isHitTestable on an object that is visible? Below is the what it says in the API Reference, it’s unclear if this should work on a object that is still visible or if it is meant only for objects that are not visible.
object.isHitTestable allows an object to continue to receive hit events even if it is not visible. If false, objects will receive hit events regardless of visibility; if false, events are only sent to visible objects.
I am trying to make my moving sprites not hittestable while they are moving, if I can’t do this using this property is there another easy way?
code:
[lua]local moveTiles = function(slot)
local addTouchProtection = function( target )
target.isHitTestable = false
end
local removeTouchProtection = function( target )
target.isHitTestable = true
end
if slot == 0 then
for j = 1, tileSlot_0.numChildren do
transition.to(tileSlot_0[j], {time=3000, x=j * spacing, transition = easing.inOutExpo, onStart = addTouchProtection, onComplete = removeTouchProtection})
end
else
for j = 1, tileSlot_1.numChildren do
transition.to(tileSlot_1[j], {time=1000, x=j * spacing, transition = easing.inOutExpo, onStart = addTouchProtection, onComplete = removeTouchProtection})
end
end
end[/lua]
[import]uid: 3018 topic_id: 1273 reply_id: 301273[/import]