2012-05-03 11:09:27 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
|
|
|
Copyright (c) 2012 NetGragon
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
#include "CCTextureWatcher.h"
|
|
|
|
#include "cocos2d.h"
|
|
|
|
|
|
|
|
using namespace std;
|
2012-05-03 11:09:27 +08:00
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
#define NUM_PER_PAGE 4
|
2012-04-27 18:47:49 +08:00
|
|
|
|
|
|
|
CCTextureWatcher::CCTextureWatcher()
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
m_bHide = false;
|
|
|
|
m_nCurrnetPage = 1;
|
|
|
|
m_nTotalPage = 0;
|
|
|
|
m_bFresh = true;
|
|
|
|
m_pTextures = NULL;
|
|
|
|
m_pszString = NULL;
|
2012-06-14 15:13:16 +08:00
|
|
|
m_pLayer = CCLayerColor::create(ccc4(128, 128, 128, 128));
|
2012-05-03 10:12:00 +08:00
|
|
|
m_pLayer->retain();
|
|
|
|
|
|
|
|
// layer
|
|
|
|
CCSize size = CCDirector::sharedDirector()->getWinSize();
|
2012-05-29 17:11:33 +08:00
|
|
|
size.height *= 0.6f;
|
2012-05-03 10:12:00 +08:00
|
|
|
m_pLayer->setContentSize(size);
|
|
|
|
|
2012-05-03 11:09:27 +08:00
|
|
|
// the menu of disabling touch event
|
2012-05-03 10:12:00 +08:00
|
|
|
//*
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *label = CCLabelTTF::create(" ", size, kCCTextAlignmentLeft, "Arial", 12);
|
|
|
|
CCMenuItemLabel *menuItem = CCMenuItemLabel::create(label);
|
2012-05-03 11:09:27 +08:00
|
|
|
menuItem->setAnchorPoint(ccp(0, 0));
|
|
|
|
menuItem->setPosition(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenu *menu = CCMenu::create(menuItem, NULL);
|
2012-05-03 11:09:27 +08:00
|
|
|
menu->setAnchorPoint(ccp(0, 0));
|
|
|
|
menu->setPosition(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
m_pLayer->addChild(menu);
|
|
|
|
//*/
|
|
|
|
|
|
|
|
// list
|
2012-06-14 15:13:16 +08:00
|
|
|
CCListView *list = CCListView::create(CCListViewModeHorizontal);
|
2012-05-03 10:12:00 +08:00
|
|
|
list->setContentSize(size);
|
|
|
|
list->setDelegate(this);
|
|
|
|
list->setSeparatorStyle(CCListViewCellSeparatorStyleNone);
|
|
|
|
m_pLayer->addChild(list);
|
|
|
|
m_pList = list;
|
|
|
|
|
|
|
|
|
2012-05-03 11:09:27 +08:00
|
|
|
// 'Hide' button
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelHide = CCLabelTTF::create("Hide ", "Arial", 24);
|
2012-05-03 10:12:00 +08:00
|
|
|
labelHide->setColor(ccc3(255, 0, 0));
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenuItemLabel *menuItem2 = CCMenuItemLabel::create(labelHide, this, menu_selector(CCTextureWatcher::actionHide));
|
2012-05-03 11:09:27 +08:00
|
|
|
menuItem2->setAnchorPoint(ccp(0, 0));
|
|
|
|
menuItem2->setPosition(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenu *menu2 = CCMenu::create(menuItem2, NULL);
|
2012-05-03 11:09:27 +08:00
|
|
|
menu2->setAnchorPoint(ccp(0, 0));
|
|
|
|
menu2->setPosition(ccp(size.width - menuItem2->getContentSize().width, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
|
|
|
|
m_labelHide = labelHide;
|
|
|
|
m_menuHide = menu2;
|
|
|
|
m_menuHide->retain();
|
|
|
|
|
2012-05-03 11:09:27 +08:00
|
|
|
// 'Fresh' button
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelFresh = CCLabelTTF::create("Fresh", "Arial", 24);
|
2012-05-03 10:12:00 +08:00
|
|
|
labelFresh->setColor(ccc3(255, 0, 0));
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenuItemLabel *menuItem1 = CCMenuItemLabel::create(labelFresh, this, menu_selector(CCTextureWatcher::actionFresh));
|
2012-05-03 11:09:27 +08:00
|
|
|
menuItem1->setAnchorPoint(ccp(0, 0));
|
|
|
|
menuItem1->setPosition(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCMenu *menu1 = CCMenu::create(menuItem1, NULL);
|
2012-05-03 11:09:27 +08:00
|
|
|
menu1->setAnchorPoint(ccp(0, 0));
|
|
|
|
menu1->setPosition(ccp(size.width - menuItem1->getContentSize().width - menuItem2->getContentSize().width * 1.5, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
m_pLayer->addChild(menu1);
|
|
|
|
|
|
|
|
// label page
|
2012-06-14 15:13:16 +08:00
|
|
|
m_labelPage = CCLabelTTF::create(" ", CCSizeMake(size.width * 0.1, labelFresh->getContentSize().height), kCCTextAlignmentCenter, "Arial", 16);
|
2012-05-03 11:09:27 +08:00
|
|
|
m_labelPage->setAnchorPoint(ccp(0.5, 0));
|
|
|
|
m_labelPage->setPosition(ccp(size.width/2.0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
m_pLayer->addChild(m_labelPage, 0);
|
2012-04-27 12:00:54 +08:00
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
CCTextureWatcher::~CCTextureWatcher()
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
if (m_menuHide)
|
2012-04-27 18:47:49 +08:00
|
|
|
{
|
|
|
|
m_menuHide->removeFromParentAndCleanup(true);
|
|
|
|
m_menuHide->release();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_pLayer)
|
|
|
|
{
|
|
|
|
m_pLayer->removeFromParentAndCleanup(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_pTextures) m_pTextures->release();
|
2012-05-03 10:12:00 +08:00
|
|
|
if (m_pszString) delete []m_pszString;
|
2012-04-27 12:00:54 +08:00
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::actionFresh(CCObject* object)
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
CCTextureWatcher::sharedTextureWatcher()->fresh();
|
2012-04-27 12:00:54 +08:00
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::actionHide(CCObject *object)
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
CCTextureWatcher::sharedTextureWatcher()->hide();
|
2012-04-27 12:00:54 +08:00
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::fresh()
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
m_nCurrnetPage = 1;
|
|
|
|
m_bFresh = true;
|
2012-04-27 12:00:54 +08:00
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::hide()
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
m_bHide = !m_bHide;
|
|
|
|
if (m_bHide)
|
|
|
|
{
|
|
|
|
m_labelHide->setString("Show");
|
2012-05-03 11:09:27 +08:00
|
|
|
m_pLayer->setPosition(ccp(0, -m_pLayer->getContentSize().height));
|
2012-05-03 10:12:00 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_labelHide->setString("Hide");
|
2012-05-03 11:09:27 +08:00
|
|
|
m_pLayer->setPosition(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
}
|
2012-04-27 12:00:54 +08:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::dovisit()
|
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
if (m_bFresh)
|
|
|
|
{
|
|
|
|
if (m_pTextures)
|
|
|
|
{
|
|
|
|
m_pTextures->removeAllObjects();
|
|
|
|
m_pTextures->release();
|
|
|
|
}
|
|
|
|
|
|
|
|
CCTextureCache::sharedTextureCache()->removeUnusedTextures();
|
|
|
|
m_pTextures = CCTextureCache::sharedTextureCache()->snapshotTextures();
|
|
|
|
m_nTotalPage = (m_pTextures->count() + NUM_PER_PAGE - 1) / NUM_PER_PAGE;
|
|
|
|
if (m_pTextures->count() > 0)
|
|
|
|
{
|
|
|
|
m_bFresh = false;
|
|
|
|
m_pList->reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CCNode *pParent = m_pLayer->getParent();
|
|
|
|
if (pParent)
|
|
|
|
{
|
|
|
|
if (pParent != CCDirector::sharedDirector()->getRunningScene())
|
|
|
|
{
|
|
|
|
pParent->removeChild(m_pLayer, true);
|
|
|
|
CCDirector::sharedDirector()->getRunningScene()->addChild(m_pLayer, 9998);
|
|
|
|
m_bFresh = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CCDirector::sharedDirector()->getRunningScene()->addChild(m_pLayer, 9998);
|
|
|
|
}
|
|
|
|
|
|
|
|
pParent = m_menuHide->getParent();
|
|
|
|
if (pParent)
|
|
|
|
{
|
|
|
|
if (pParent != CCDirector::sharedDirector()->getRunningScene())
|
|
|
|
{
|
|
|
|
pParent->removeChild(m_menuHide, true);
|
|
|
|
CCDirector::sharedDirector()->getRunningScene()->addChild(m_menuHide, 9999);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CCDirector::sharedDirector()->getRunningScene()->addChild(m_menuHide, 9999);
|
|
|
|
}
|
2012-04-27 18:47:49 +08:00
|
|
|
}
|
|
|
|
void CCTextureWatcher::visit(void* pSender)
|
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
CCTextureWatcher *wartcher = (CCTextureWatcher*)pSender;
|
|
|
|
wartcher->dovisit();
|
2012-04-27 18:47:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static CCTextureWatcher *g_sharedTextureWatcher = NULL;
|
|
|
|
|
|
|
|
CCTextureWatcher* CCTextureWatcher::sharedTextureWatcher()
|
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
if (!g_sharedTextureWatcher)
|
2012-04-27 18:47:49 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
g_sharedTextureWatcher = new CCTextureWatcher();
|
2012-04-27 18:47:49 +08:00
|
|
|
}
|
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
return g_sharedTextureWatcher;
|
2012-04-27 18:47:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void CCTextureWatcher::purgeTextureWatcher()
|
|
|
|
{
|
|
|
|
if (g_sharedTextureWatcher != NULL)
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(g_sharedTextureWatcher);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCTextureWatcher::setDisplayWatcher(bool bDisplayWatcher)
|
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
m_bDisplayWatcher = bDisplayWatcher;
|
|
|
|
if (m_bDisplayWatcher)
|
|
|
|
{
|
|
|
|
if (m_pszString == NULL)
|
|
|
|
{
|
|
|
|
m_pszString = new char[64];
|
|
|
|
}
|
|
|
|
CCDirector::sharedDirector()->setWatcherCallbackFun(this, &CCTextureWatcher::visit);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
CCDirector::sharedDirector()->setWatcherCallbackFun(NULL, NULL);
|
2012-04-27 18:47:49 +08:00
|
|
|
purgeTextureWatcher();
|
2012-05-03 10:12:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCTextureWatcher::CCListView_numberOfCells(CCListView *listView, CCListViewProtrolData *data)
|
|
|
|
{
|
|
|
|
data->nNumberOfRows = m_nTotalPage;
|
2012-04-27 18:47:49 +08:00
|
|
|
}
|
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
void CCTextureWatcher::CCListView_cellForRow(CCListView *listView, CCListViewProtrolData *data)
|
2012-04-27 18:47:49 +08:00
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
m_nCurrnetPage = data->nRow + 1;
|
|
|
|
CCListViewCell *cell = CCListViewCell::node();
|
|
|
|
cell->setOpacity(0);
|
|
|
|
cell->setContentSize(m_pList->getContentSize());
|
|
|
|
cell->setSelectionColor(ccc4(0, 0, 0, 0));
|
|
|
|
data->cell = cell;
|
2012-04-27 18:47:49 +08:00
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
CCSize listItemSize = CCSize(m_pList->getContentSize().width / NUM_PER_PAGE, m_pList->getContentSize().height);
|
2012-04-27 12:00:54 +08:00
|
|
|
|
2012-05-29 17:11:33 +08:00
|
|
|
CCSize size = CCSize(listItemSize.width * 0.9f, listItemSize.height * 0.6f);
|
2012-04-27 12:00:54 +08:00
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
sprintf(m_pszString, "%d/%d", m_nCurrnetPage, m_nTotalPage);
|
|
|
|
m_labelPage->setString(m_pszString);
|
2012-04-27 12:00:54 +08:00
|
|
|
|
2012-05-29 17:11:33 +08:00
|
|
|
float offX = 0.0f, offY = 0.0f, offsetX = 0.0f, offsetY = 0.0f;
|
2012-05-03 10:12:00 +08:00
|
|
|
CC_UNUSED_PARAM(offsetY);
|
|
|
|
int nCount = 0;
|
|
|
|
int nStart = (m_nCurrnetPage - 1) * NUM_PER_PAGE;
|
|
|
|
int nEnd = nStart + NUM_PER_PAGE;
|
2012-04-27 12:00:54 +08:00
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
CCDictElement* pElement = NULL;
|
|
|
|
CCDICT_FOREACH(m_pTextures, pElement)
|
|
|
|
{
|
2012-05-03 10:12:00 +08:00
|
|
|
if (nCount >= nStart && nCount < nEnd)
|
|
|
|
{
|
|
|
|
string key = pElement->getStrKey();
|
|
|
|
CCTexture2D* textrue = (CCTexture2D*)pElement->getObject();
|
|
|
|
//textrue = m_pTextures->objectForKey(*it);
|
|
|
|
if (textrue)
|
|
|
|
{
|
2012-05-03 11:09:27 +08:00
|
|
|
// reference count
|
2012-05-03 10:12:00 +08:00
|
|
|
sprintf(m_pszString, "[%d]", textrue->retainCount() - 2);
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelCount = CCLabelTTF::create(m_pszString, "Arial", 16);
|
2012-05-03 10:12:00 +08:00
|
|
|
if (textrue->retainCount() - 2 > 0)
|
|
|
|
{
|
|
|
|
labelCount->setColor(ccc3(0, 255, 0));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
labelCount->setColor(ccc3(255, 0, 0));
|
|
|
|
}
|
2012-05-29 17:11:33 +08:00
|
|
|
offX = offsetX + listItemSize.width * 0.5f - labelCount->getContentSize().width * 0.5f;
|
|
|
|
offY = (listItemSize.height - size.height) * 0.5f - labelCount->getContentSize().height;
|
2012-05-03 11:09:27 +08:00
|
|
|
labelCount->setPosition(ccp(offX, offY));
|
|
|
|
labelCount->setAnchorPoint(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
cell->addChild(labelCount);
|
|
|
|
|
2012-05-03 11:09:27 +08:00
|
|
|
// texture size
|
2012-05-03 10:12:00 +08:00
|
|
|
sprintf(m_pszString, "%.0f*%.0f", textrue->getContentSize().width, textrue->getContentSize().height);
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelSize = CCLabelTTF::create(m_pszString, "Arial", 16);
|
2012-05-29 17:11:33 +08:00
|
|
|
offX = offsetX + listItemSize.width * 0.5f;
|
|
|
|
offY = (listItemSize.height - size.height) * 0.5f + size.height;
|
2012-05-03 11:09:27 +08:00
|
|
|
labelSize->setPosition(ccp(offX, offY));
|
2012-05-29 17:11:33 +08:00
|
|
|
labelSize->setAnchorPoint(ccp(0.5f, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
cell->addChild(labelSize);
|
|
|
|
|
2012-05-03 11:09:27 +08:00
|
|
|
// texture name
|
2012-05-03 10:12:00 +08:00
|
|
|
int len = key.length();
|
|
|
|
int pos = 0;
|
2012-05-03 11:09:27 +08:00
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
pos = key.rfind('\\') + 1;
|
|
|
|
int pos2 = key.rfind('/') + 1;
|
|
|
|
pos = pos > pos2 ? pos : pos2;
|
2012-05-03 11:09:27 +08:00
|
|
|
|
2012-05-03 10:12:00 +08:00
|
|
|
string name = key.substr(pos, len - pos);
|
|
|
|
sprintf(m_pszString, "%s", name.c_str());
|
2012-05-29 17:11:33 +08:00
|
|
|
CCSize dimensions = CCSizeMake(listItemSize.width * 0.9f, labelSize->getContentSize().height);
|
2012-06-14 15:13:16 +08:00
|
|
|
CCLabelTTF *labelName = CCLabelTTF::create(m_pszString, dimensions, kCCTextAlignmentCenter, "Arial", 16);
|
2012-05-29 17:11:33 +08:00
|
|
|
offX = offsetX + listItemSize.width * 0.5f;
|
2012-05-03 10:12:00 +08:00
|
|
|
offY = offY + labelName->getContentSize().height;
|
2012-05-03 11:09:27 +08:00
|
|
|
labelName->setPosition(ccp(offX, offY));
|
2012-05-29 17:11:33 +08:00
|
|
|
labelName->setAnchorPoint(ccp(0.5f, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
cell->addChild(labelName);
|
|
|
|
|
2012-06-14 15:13:16 +08:00
|
|
|
CCSprite *sprite = CCSprite::createWithTexture(textrue);
|
2012-05-03 11:09:27 +08:00
|
|
|
sprite->setAnchorPoint(ccp(0, 0));
|
2012-05-03 10:12:00 +08:00
|
|
|
|
|
|
|
CCSize spriteSize = sprite->getContentSize();
|
|
|
|
float scale;
|
|
|
|
if (spriteSize.width < size.width && spriteSize.height < size.height)
|
|
|
|
{
|
|
|
|
scale = 1;
|
|
|
|
}
|
|
|
|
else if (spriteSize.width * size.height >= spriteSize.height * size.width)
|
|
|
|
{
|
|
|
|
scale = size.width / spriteSize.width;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
scale = size.height / spriteSize.height;
|
|
|
|
}
|
|
|
|
sprite->setScale(scale);
|
|
|
|
spriteSize.width *= scale;
|
|
|
|
spriteSize.height *= scale;
|
2012-05-29 17:11:33 +08:00
|
|
|
offX = offsetX + (listItemSize.width - spriteSize.width) * 0.5f;
|
|
|
|
offY = (listItemSize.height - spriteSize.height) * 0.5f;
|
2012-05-03 11:09:27 +08:00
|
|
|
sprite->setPosition(ccp(offX, offY));
|
2012-05-03 10:12:00 +08:00
|
|
|
cell->addChild(sprite);
|
|
|
|
offsetX += listItemSize.width;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
++nCount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CCTextureWatcher::CCListView_didClickCellAtRow(CCListView *listView, CCListViewProtrolData *data)
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
void CCTextureWatcher::CCListView_didScrollToRow(CCListView *listView, CCListViewProtrolData *data)
|
2012-04-27 12:00:54 +08:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2012-04-27 18:47:49 +08:00
|
|
|
NS_CC_EXT_END
|