Esempio n. 1
0
// process touch
bool NPCManager::processTouch(CCPoint touchPoint)
{
	if(m_canTouch)
	{
        float deviceScale = CC_CONTENT_SCALE_FACTOR();
        CCPoint tPoint = CCPoint(touchPoint.x / deviceScale, touchPoint.y / deviceScale);
		map<uint8_t, NPC*>::const_iterator iter = m_npcMap.begin();
		for(; iter != m_npcMap.end(); ++iter)
		{
			NPC* pNPC = iter->second;
			if(pNPC->isShowOnMap() && pNPC->processTouch(tPoint))
			{
				return true;
			}
		}
	}

	return false;
}