Exemple #1
0
void CCTouchInjector::setEnabled(bool flag)
{
	if (m_Enabled == flag) return;

	CCTouchDispatcher* td = CCTouchDispatcher::sharedDispatcher();

	if (flag)
	{
		td->holdUserTouch();
		td->injectTouches(m_Touches, CCTOUCHBEGAN);
	}
	else
	{
		td->injectTouches(m_Touches, CCTOUCHENDED);
		td->unholdUserTouch();
	}
}