Pinch Zoom Gesture - #

Heya,

I just downloaded the Pinch Zoom Gesture sample code from the Ansca’ examples. One thing confused me; line 100 is:

 if ( #previousTouches \> 0 ) then  
 -- must be at least 2 touches remaining to pinch/zoom  
 self.distance = nil  

I’ve never seen a #prefix before. Is it a typo, or is it dark Lua magic I’ve not yet mastered? previousTouches is just a simple table indexed by event.id.

 previousTouches = {}  
 self.previousTouches = previousTouches  

Presumably it’s a typo and it could just be:

if previousTouches then   
 ...  

However would love to know if there’s more going on. [import]uid: 11757 topic_id: 9369 reply_id: 309369[/import]

Ah figured it out. #previousTouches gets the number of elements in a table. I didn’t know that. Is it fast? [import]uid: 11757 topic_id: 9369 reply_id: 34250[/import]

yup very fast just six minutes [import]uid: 12482 topic_id: 9369 reply_id: 34251[/import]

dang, 6 minutes? that is fast [import]uid: 28912 topic_id: 9369 reply_id: 47854[/import]