void CardBaCay::give_next(CCArray *P, float _width, float _height, float _left, float _bottom, int count) { count_give++; Card *card = new Card("card_back.png"); card->setPosition(ccp(WIDTH_DESIGN / 2 - w_card_notme / 2, HEIGHT_DESIGN / 2 - h_card_notme / 2)); card->setScaleCard(w_card_notme / card->getContentSize().width, h_card_notme / card->getContentSize().height); card->setVisible(true); this->addChild(card); CCMoveBy *newTo = CCMoveTo::create(0.3, ccp(_left + P->count() *_width, _bottom)); CCScaleBy *scaleTo = CCScaleBy::create(0.3, _width / w_card_notme, _height / h_card_notme); card->runAction(newTo); card->runAction(scaleTo); P->addObject(card); if (count_give < count) { this->runAction(CCSequence::create(CCDelayTime::create(0.3),CCCallFunc::create(this, callfunc_selector(CardBaCay::givePocker)),NULL)); } else { //setCallBack CCLOG("Call back"); if (m_callback && m_callbackListener) { (m_callback->*m_callbackListener)(this); } } }
void CardBaCay::createListCard_Back(CCArray *P, float _width, float _height, float _left, float _bottom) { for (int i = 0; i < 3; i++) { Card *pCard = new Card("card_back.png"); pCard->setScaleCard(_width / pCard->getContentSize().width, _height / pCard->getContentSize().height); pCard->setPosition(ccp(_left + i * _width, _bottom)); pCard->setVisible(true); P->addObject(pCard); this->addChild(pCard); } }