displaying an image when a tableview row is in certain y position

Hi guys,

I’m trying tu build a table view similar to Fruit Ninja’s blade selection table.
Basically what I am looking for is that when the rows are scrolled to a certain ‘y’ position a custom graphic displays in a box outside of the tableview.
Each graphic is different according to the row that is in the “selection” ‘y’ position.

many thanks for your help.

[import]uid: 74667 topic_id: 33187 reply_id: 333187[/import]

list:getContentPostiion() http://docs.coronalabs.com/api/type/TableViewWidget/getContentPosition.html

will return you the Y of the list. That in combination with a Runtime:addEventListener(“enterFrame”,showProduct) listener shoudl do the trick for you.

Note, this is generally a negative number but you can do a math.abs() on it and divide by your row height to get a number relative to the top most row. [import]uid: 19626 topic_id: 33187 reply_id: 131819[/import]

thanks so much @robmiracle! worked perfect! :slight_smile: [import]uid: 74667 topic_id: 33187 reply_id: 131851[/import]

list:getContentPostiion() http://docs.coronalabs.com/api/type/TableViewWidget/getContentPosition.html

will return you the Y of the list. That in combination with a Runtime:addEventListener(“enterFrame”,showProduct) listener shoudl do the trick for you.

Note, this is generally a negative number but you can do a math.abs() on it and divide by your row height to get a number relative to the top most row. [import]uid: 19626 topic_id: 33187 reply_id: 131819[/import]

thanks so much @robmiracle! worked perfect! :slight_smile: [import]uid: 74667 topic_id: 33187 reply_id: 131851[/import]