Hello guys!
I’m currently using CCTableView extension to show an item shop to the player. Everything is working fine, there’s just this small “problem” that is annoying me: for some reason, when you scroll the item list, the rows gets reordered, probably because CCTableView disposes a cell when it gets out of view. Is there a way to avoid this?
I’m also leaving here my TableCellButton, a CCTableViewCell that works like a CCMenuItemSprite, you just need to use tableCellTouched, tableCellHighlight and tableCellUnhighlight from a CCTableViewDelegate like this:
void TableViewDelegate::tableCellTouched(CCTableView* table, CCTableViewCell* cell) {
TableCellButton* t = (TableCellButton*)(cell);
if(t)
t->activate();
}
void TableViewDelegate::tableCellHighlight(CCTableView* table, CCTableViewCell* cell) {
TableCellButton* t = (TableCellButton*)(cell);
if(t)
t->selected();
}
void TableViewDelegate::tableCellUnhighlight(CCTableView* table, CCTableViewCell* cell) {
TableCellButton* t = (TableCellButton*)(cell);
if(t)
t->unselected();
}
TableCellButton.h.zip (0.8 KB)
TableCellButton.cpp.zip (1.1 KB)