Well there are many options, that could work based on what you need to do with object. You may (as you did) position obejct of the screen, or set scale to 0 or remove object from parent and than add it back when you need it
@ar2rsawseen: thank, that's complicated but seem we have no way @zaniar: you misunderstood my problem For example after I hide an object, I want to inactive that object too (like in Corona SDK) but it's still there and still fire event onclick (just only invisible)
@zaniar: you misunderstood my problem For example after I hide an object, I want to inactive that object too (like in Corona SDK) but it's still there and still fire event onclick (just only invisible)
i think he is trying to suggest something like this,
localfunction onMouseDown(self, event)if self:hitTestPoint(event.x, event.y)thenif self:isVisible()then-- some actionendendend
@hgvyas123 I have edited my sample just as you were posting because it was taken from a project with other requirements so it's possible your comment refers to the previous version now.
Comments
You may (as you did) position obejct of the screen, or
set scale to 0 or
remove object from parent and than add it back when you need it
@zaniar: you misunderstood my problem For example after I hide an object, I want to inactive that object too (like in Corona SDK) but it's still there and still fire event onclick (just only invisible)
Ultimate Games on Appstore
Ultimate Games on Google Play
Likes: zaniar
Likes: hgvyas123
I have edited my sample just as you were posting because it was taken from a project with other requirements so it's possible your comment refers to the previous version now.
now i dont think so there is any difference in perfomance or efficiency between this two func
might be logically
if self:isVisible() then
-- some action
end
is faster than
if not(self:isVisible()) then
return
end
-- some action
but that diff can be ignored totally especially for 2-3 objects [ how many objects we can except which are touched at the same time]