Пример #1
0
	void UIScrollLayer::cancelAndStoleTouch(CCTouch* pTouch, CCEvent* pEvent)
	{
		// Throw Cancel message for everybody in TouchDispatcher.
		CCSet* touchSet = new CCSet();
		touchSet->addObject(pTouch);
		touchSet->autorelease();
		CCDirector::sharedDirector()->getTouchDispatcher()->touchesCancelled(touchSet, pEvent);
    
		//< after doing this touch is already removed from all targeted handlers
    
		// Squirrel away the touch
		claimTouch(pTouch);
	}
void CCStoreScene::testLoadProducts(CCObject* pSender)
{
    CCSet* productsId = new CCSet();
    productsId->autorelease();
    
    CCNative::createAlert("Waiting", "Retrieving Product Information", NULL);
    CCNative::showAlert();
    
    // SET YOUR IAP PRODUCT ID TO HERE
    productsId->addObject(newCCString("org.cocos2d-x.games.demo.iap01"));
    productsId->addObject(newCCString("org.cocos2d-x.games.demo.iap02"));
    productsId->addObject(newCCString("org.cocos2d-x.games.demo.iap03"));
    CCStore::sharedStore()->loadProducts(productsId, this);
}
Пример #3
0
CCSet* CCActionManager::pauseAllRunningActions()
{
    CCSet *idsWithActions = new CCSet();
    idsWithActions->autorelease();
    
    for (tHashElement *element=m_pTargets; element != NULL; element = (tHashElement *)element->hh.next) 
    {
        if (! element->paused) 
        {
            element->paused = true;
            idsWithActions->addObject(element->target);
        }
    }    
    
    return idsWithActions;
}