Exemplo n.º 1
0
bool CCProgressTimer::initWithSprite(CCSprite* sp)
{
    setPercentage(0.0f);
    m_pVertexData = NULL;
    m_nVertexDataCount = 0;

    setAnchorPoint(ccp(0.5f,0.5f));
    m_eType = kCCProgressTimerTypeRadial;
    m_bReverseDirection = false;
    setMidpoint(ccp(0.5f, 0.5f));
    setBarChangeRate(ccp(1,1));
    setSprite(sp);
    // shader program
    setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTextureColor));
    return true;
}
Exemplo n.º 2
0
bool ProgressTimer::initWithSprite(Sprite* sp)
{
    setPercentage(0.0f);
    _vertexData = NULL;
    _vertexDataCount = 0;

    setAnchorPoint(Point(0.5f,0.5f));
    _type = Type::RADIAL;
    _reverseDirection = false;
    setMidpoint(Point(0.5f, 0.5f));
    setBarChangeRate(Point(1,1));
    setSprite(sp);
    // shader program
    setShaderProgram(ShaderCache::getInstance()->getProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
    return true;
}
Exemplo n.º 3
0
void BloodBar::onEnter()
{
	CCNode::onEnter();
	addChild(CCSprite::createWithSpriteFrameName("war_commonui_xt_di.png"), 0);
	addChild(CCSprite::createWithSpriteFrameName("war_commonui_xt_liti.png"), 2);
	CCSprite* progressSprite = CCSprite::createWithSpriteFrameName("war_commoneui_xt_cont.png");
	progressSprite->setCascadeColorEnabled(false);
	progressSprite->setColor(ccc3(0, 255, 0));
	mProgressBar = CCProgressTimer::create(progressSprite);
	mProgressBar->setType(kCCProgressTimerTypeBar);
	mProgressBar->setBarChangeRate(ccp(1, 0)); 
	mProgressBar->setMidpoint(ccp(0,0));
	
	addChild(mProgressBar, 1);
	setPercentage(0.999f);
}
Exemplo n.º 4
0
bool ProgressTimer::initWithSprite(Sprite* sp)
{
    setPercentage(0.0f);
    _vertexData = nullptr;
    _vertexDataCount = 0;

    setAnchorPoint(Vector2(0.5f,0.5f));
    _type = Type::RADIAL;
    _reverseDirection = false;
    setMidpoint(Vector2(0.5f, 0.5f));
    setBarChangeRate(Vector2(1,1));
    setSprite(sp);

    // shader state
    setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
    return true;
}
Exemplo n.º 5
0
bool CCastleHpBar::init(){
    if(!ProgressTimer::init())return false;
    Sprite* sp = Sprite::create("");
    setSprite(sp);
    
    setPercentage(100);
    
    setType(ProgressTimerType::BAR);
    
    setBarChangeRate(Vec2(-1,0));
    
    setMidpoint(Vec2(1,0));
    
    
    scheduleUpdate();
    
    return true;
}
Exemplo n.º 6
0
bool Loading::init()
{
	textureCacheArray = __Array::create();
	textureCacheArray->retain();

	mpFontChina = FontChina::getInstance();
	mpFontChina->initStringXml();

	

	auto spriteBG = Sprite::create("TempPic/Loading/loading1.png");
	spriteBG->setPosition(Point(400, 240));
	this->addChild(spriteBG);
	
	auto size = Director::getInstance()->getVisibleSize();
	auto spriteProgress = Sprite::create("TempPic/Loading/Loading.png");
	auto progressBar = ProgressTimer::create(spriteProgress);
	progressBar->setType(ProgressTimer::Type::BAR);
	progressBar->setMidpoint(Point::ANCHOR_BOTTOM_LEFT);
	progressBar->setBarChangeRate(Point::ANCHOR_BOTTOM_RIGHT);
	progressBar->setPosition(Point(size.width / 2, 0 + 80));
	progressBar->setPercentage(0);
	this->addChild(progressBar, 10, PROGRESSTAG);

	auto sprite2 = Sprite::create("TempPic/Loading/LoadingBG.png");
	sprite2->setPosition(Point(size.width / 2, 0 + 80));
	this->addChild(sprite2, 2);

	auto label = Label::create();
	label->setPosition(Point(400, 40));
	label->setSystemFontSize( 20.0f );
	this->addChild(label, 10);

	auto nameString = __String::createWithFormat("Loading%d", ToolFunc::calcRandom(1, 19));
	auto labelString = __String::createWithFormat("%s", mpFontChina->getComString(nameString->getCString())->getCString());
	label->setString(labelString->getCString());

	return true;
}
Exemplo n.º 7
0
void Field::statistics_dialog() {
    auto stat_dialog = new StatisticsWidget;
    auto ui = new Ui::Statistics;
    ui->setupUi(stat_dialog);
    int bestTime = 0;

    if (rows == 9  && cols == 9  && mines == 10) {
        bestTime = bestBeginnerTime;
    } else if(rows == 16 && cols == 16 && mines == 40) {
        bestTime = bestIntermediateTime;
    } else if(rows == 16 && cols == 30 && mines == 99) {
        bestTime = bestAdvancedTime;
    }

    stat_dialog->setBestTime(bestTime);
    stat_dialog->setPlayedGames(gamesPlayed);
    stat_dialog->setWonGames(gamesWon);
    stat_dialog->setPercentage(static_cast<float>(gamesWon) / gamesPlayed * 100);
    connect(stat_dialog->findChild<QPushButton*>("clearBtn"), SIGNAL(released()),
            SLOT(clearStatistics()));
    stat_dialog->show();
}
Exemplo n.º 8
0
void StartScene::addTarget()
{
    DataModel *m = DataModel::getModel();
    Wave *wave = this->getCurrentWave();
    if(wave==nullptr)
        this->cleanup();
    if (wave->totalCreeps <= 0)
    {
        if (m->targets.size()==0)
            getNextWave();
        return;
    }
    wave->totalCreeps--;
    Creep *target = NULL;

    /*
     int random = rand()%3;
     if (random == 0)
     {
     target = FastGrayCreep::creep(m->waypoints.size());
     }
     else  if(random == 1)
     {
     target = StrongGreenCreep::creep(m->waypoints.size());
     }
     else
     {
     target = MonsterYellowCreep::creep(m->waypoints.size());
     }
     */


    target = Creep::createWithType(wave->creeptype,m->waypoints.size(),true);
    WayPoint *waypoint = target->getCurrentWaypoint();
    target->setPosition(waypoint->getPosition());
    waypoint = target->getNextWaypoint();
    auto lifeBar = CCProgressTimer::create(CCSprite::create("loginbg.png"));
    lifeBar->setType(kCCProgressTimerTypeBar);
    lifeBar->setPercentage(100.0f);
    lifeBar->setBarChangeRate(ccp(1, 0));//水平方向
    lifeBar->setMidpoint(ccp(0,0));//设置起始点为左下方
    lifeBar->setPosition(target->sprite->getPosition().x, target->sprite->getPosition().y+60);
    lifeBar->setScaleY(0.6);
    lifeBar->setScaleX(0.3);
    target->addChild(lifeBar,1);
    target->lifeBar = lifeBar;
    auto emptyLifeBar = Sprite::create("login_dbg.png");
    emptyLifeBar->setScaleX(0.3);
    emptyLifeBar->setScaleY(0.3);
    emptyLifeBar->setPosition(lifeBar->getPosition());
    target->addChild(emptyLifeBar,0);
    target->emptyLifeBar = emptyLifeBar;
    this->addChild(target, 1);
    int moveDuration = target->moveDuration;
    auto actionMove = CCMoveTo::create(moveDuration, waypoint->getPosition());
    auto lifeBarActionMove = MoveTo::create(moveDuration, ccp(waypoint->getPosition().x,waypoint->getPosition().y+25));
    auto actionMoveDone = CallFuncN::create(this, callfuncN_selector(StartScene::FollowPath));
    target->runAction(CCSequence::create(actionMove, actionMoveDone, NULL));
//    lifeBar->runAction(CCSequence::create(lifeBarActionMove, NULL));
    target->tag = 1;
    m->targets.pushBack(target);
}
Exemplo n.º 9
0
void CCastleHpBar::update(float _dt){
    setPercentage(m_Hp);
}
Exemplo n.º 10
0
void ProgressBarNode::SetProtoData( const CoreProto::Editor::ProgressBar& val )
{
	mProtoData = val;
	SetName(val.id());

	CCSprite* sprite=new CCSprite();
	sprite->autorelease();
	FileSystemOrderItem* orderItem=ResourceManager::Instance().InitSprite(sprite,val.image(),val.size());
	if (orderItem==NULL)
	{
		Log::LogErrorFormat("ProgressBarNode:Cannot find image:%s",val.image().file().name().c_str());
		return;
	}

	if(!initWithSprite(sprite))
	{
		Log::LogErrorFormat("Cannot init progress bar:%s",val.id().c_str());
		return;
	}


	Point2F offset=orderItem->GetOffsetOrZero();
	Size2F originalSize=orderItem->GetOriginalSizeOrZero();
	Point2F newAnchorPoint=Point2F(val.anchor().x(),val.anchor().y());

	if (offset!=Point2F::Zero)
	{
		CCSize contentSize=getContentSize();
		newAnchorPoint= LayerEditor::CalculateAnchor(newAnchorPoint,offset,Size2F(contentSize.width,contentSize.height),Size2F(contentSize.width,contentSize.height));
	}

	//setFlipX(val.isfilpx());
	//setFlipY(val.isfilpy());
	setZOrder(val.zorder());
	setVisible(val.isvisible());
	setAnchorPoint(ccp(newAnchorPoint.X,newAnchorPoint.Y));
	if (val.has_scale())
	{
		setScaleX(val.scale().x());
		setScaleY(val.scale().y());
	}
	else
	{
		setScale(1.f);
	}

	setRotation(val.rotation());
	SetRenderFlag((RenderFlag)val.renderflag());

	if (val.isproportionpoint())
	{
		CCSize winSize= CCDirector::sharedDirector()->getWinSizeInPixels();

		setPosition(ccp(val.position().x()*winSize.width,val.position().y()*winSize.height));
	}
	else
	{
		setPosition(ccp(val.position().x(),val.position().y()));
	}
	
	setPercentage(100.f);

	
	setType((CCProgressTimerType)val.type());

	CCPoint midPos = ccp(val.midpoint().x(),val.midpoint().y());
	if (getType() == kCCProgressTimerTypeRadial)
	{
		midPos.x = Math::Clamp(midPos.x,0.001f,0.9999f);
		midPos.y = Math::Clamp(midPos.y,0.001f,0.9999f);
	}
	setMidpoint(midPos);
	setBarChangeRate(ccp(val.changerate().x(),val.changerate().y()));
	setTag(val.tag());
}
Exemplo n.º 11
0
void GateResult::resetUI()//初始化界面
{
    Widget* img_bg=(Widget*)layout->getChildByName("img_bg");
    img_bg->setVisible(true);
    bool isWin=this->pResultResp.star()!=0;
    Widget* img_win=(Widget*)img_bg->getChildByName("img_win");
    Widget* img_lose=(Widget*)img_bg->getChildByName("img_lose");
    img_win->setVisible(isWin);
    img_lose->setVisible(!isWin);
    Button* btn_return=(Button*)layout->getChildByName("btn_return");
    btn_return->setVisible(true);
    btn_return->addTouchEventListener(CC_CALLBACK_2(GateResult::touchButtonEvent, this));
    Text* tf_groupLvl=static_cast<Text*>(img_bg->getChildByName("tf_groupLvl"));
    Text* tf_groupExp=static_cast<Text*>(img_bg->getChildByName("tf_groupExp"));
    Text* tf_coin=static_cast<Text*>(img_bg->getChildByName("tf_coin"));
    tf_groupLvl->setString(Value(this->pResultResp.curgrouplvl()).asString());
    tf_groupExp->setString(StringUtils::format("+%d",this->pResultResp.groupexp()));
    tf_coin->setString(StringUtils::format("+%d",this->pResultResp.coin()));
    for(int i=1;i<=3;i++){
        Node* star=img_bg->getChildByName("star_"+Value(i).asString());
        star->setVisible(i<=this->pResultResp.star());
    }
    for (int i=0; i<5; i++) {
        Widget* npc=static_cast<Widget*>(img_bg->getChildByName("role_"+Value(i+1).asString()));
        ImageView* item=static_cast<ImageView*>(img_bg->getChildByName("item_"+Value(i+1).asString()));
        npc->setVisible(i<this->pResultResp.npcs_size());
        item->setVisible(i<this->pResultResp.items_size());
        if (i<this->pResultResp.npcs_size()) {
            PNpcRes pNpcRes=this->pResultResp.npcs(i);
            string addLevel=Value(pNpcRes.addlvl()).asString();
            string addExp=Value(pNpcRes.addexp()).asString();
            int totalLvl=pNpcRes.curlvl()+pNpcRes.addlvl();
            int oldExp=Manager::getInstance()->getCurrExp(pNpcRes.curexp(), pNpcRes.curlvl());
            int currExp=Manager::getInstance()->getCurrExp(pNpcRes.curexp()+pNpcRes.addexp(), totalLvl);
            int neddExp=XExp::record(Value(totalLvl))->getExp();
            float oldPrecent=float(oldExp*100/neddExp);
            float curPrecent=float(currExp*100/neddExp);
            static_cast<TextAtlas*>(npc->getChildByName("txt_lvl"))->setString(Value(totalLvl).asString());
            auto action = ProgressTo::create(abs(curPrecent-oldExp)/100, curPrecent);
            LoadingBar* loadingBar=static_cast<LoadingBar*>(npc->getChildByName("pro_exp"));
            loadingBar->setVisible(false);
            auto progressTimer = ProgressTimer::create(static_cast<Sprite*>(loadingBar->getVirtualRenderer()));
            progressTimer->setType(ProgressTimer::Type::BAR);
            progressTimer->setPosition(loadingBar->getPosition());
            npc->addChild(progressTimer);
            //Setup for a bar starting from the left since the midpoint is 0 for the x
            progressTimer->setMidpoint(Vec2(0,0));
            //Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
            progressTimer->setBarChangeRate(Vec2(1, 0));
            progressTimer->setPercentage(oldPrecent>curPrecent?0:oldExp);
            progressTimer->runAction(action);
            static_cast<Text*>(npc->getChildByName("txt_addExp"))->setString(StringUtils::format("EXP+%d",pNpcRes.addexp()));
            if(pNpcRes.addlvl()>0){
                Clip* clip=Clip::create("levelUp.plist", "levelUp",8);
                clip->setPosition(npc->getContentSize().width/2-5,npc->getContentSize().height/2-7);
                clip->play(true);
                npc->addChild(clip);
            }
            

            //loadingBar->setPercent(50);
            //static_cast<Text*>(npc->getChildByName("txt_exp"))->setString(Utils::getLang("EXP+{1}",params));
            //pNpcRes
        }
        if (i<this->pResultResp.items_size()) {
            PItemRes pItemRes=this->pResultResp.items(i);
            static_cast<Text*>(item->getChildByName("txt_num"))->setString(Value(pItemRes.itemnum()).asString());
            XItem* xItem=XItem::record(Value(pItemRes.itemid()));
            item->loadTexture("item_"+Value(xItem->getIcon()).asString()+".png");
            item->addTouchEventListener(CC_CALLBACK_2(GateResult::touchItemEvent, this));
            item->setTouchEnabled(true);
            item->setTag(pItemRes.itemid());
            Manager::getInstance()->showMsg(StringUtils::format("获得%sX%d",xItem->getName().c_str(),pItemRes.itemnum()));

        }
    }
}
Exemplo n.º 12
0
void GameGuiLayer::update(float dt){

	if (GAMEDATA::getInstance()->updateScore){
		GAMEDATA::getInstance()->updateScore = false;
		updateScore();
	}

	Size visibleSize = Director::getInstance()->getVisibleSize();
	Vec2 origin = Director::getInstance()->getVisibleOrigin();
	auto right = ProgressTimer::create(Sprite::create("progressbar.png"));
	right->setType(ProgressTimer::Type::BAR);
	right->setScaleY(0.95f);
	right->setPosition(240, 712);
	auto to4 = ProgressTo::create(GAMEDATA::getInstance()->gettime(), 0);
	right->setMidpoint(ccp(0, 0));
	right->setBarChangeRate(ccp(1, 0));
	right->setPercentage(GAMEDATA::getInstance()->gettime() * 10);
	this->addChild(right, 0);
	right->runAction(to4);

	//add addtime
	auto addtime = Menu::create();
	auto spriteNomal = Sprite::create("addtime.png");
	spriteNomal->setScale(0.8, 0.8);
	auto spriteSelect = Sprite::create("addtime.png");
	spriteSelect->setScale(0.9, 0.9);
	auto add_time = MenuItemSprite::create(spriteNomal, spriteSelect, CC_CALLBACK_0(GameGuiLayer::addTimeBtn, this));
	add_time->setPosition(400, visibleSize.height - 80);
	addtime->addChild(add_time);
	addtime->setPosition(Point(0, 0));
	this->addChild(addtime);

	Sprite* timebg = Sprite::create("numBG.png");
	timebg->setPosition(435, visibleSize.height - 85);
	timebg->setScale(0.8);
	addChild(timebg);

	label = CCLabelTTF::create();
	ccColor3B color;
	color.r = 240;
	color.g = 255;
	color.b = 255;
	label->setColor(color);
	label->setScale(1.2);
	label->setPosition(435, visibleSize.height - 85);

	this->addChild(label);

	char* time = new char[100];
	int addtimenum = GAMEDATA::getInstance()->getaddtimeNum();

	if (addtimenum<0)
	{
		addtimenum == 0;
	}
	sprintf(time, "%d", addtimenum);
	label->setString(time);

	char* tip_num = new char[100];
	int tipnum = GAMEDATA::getInstance()->gettipNum();
	if (tipnum<0)
	{
		tipnum == 0;
	}
	sprintf(tip_num, "%d", tipnum);
	label1->setString(tip_num);

	char* refresh_num = new char[100];
	int refreshnum = GAMEDATA::getInstance()->getrefreshNum();
	if (refreshnum<0)
	{
		refreshnum == 0;
	}
	sprintf(refresh_num, "%d", refreshnum);
	label2->setString(refresh_num);

	//add tree
	auto tree = Sprite::create("tree.png");
	tree->setPosition(70, visibleSize.height - 140);
	tree->setScale(0.8);
	addChild(tree);


	// goto result scene
	float stime = GAMEDATA::getInstance()->gettime();
	if (stime<=3){
		notime->setVisible(true);
		
	}
	if (stime <= 2.5){
		notime->setVisible(false);

	}
	if (stime <= 2){
		notime->setVisible(true);

	}
	if (stime <= 1.5){
		notime->setVisible(false);

	}
	if (stime <= 1){
		notime->setVisible(true);

	}
	if (stime <= 0.5){
		notime->setVisible(false);

	}
	if (stime<0){
		GAMEDATA::getInstance()->settime(11);
		Audio::getInstance()->timeover();
		Director::getInstance()->replaceScene(TransitionFade::create(1, GameResultScene::create()));
	}

	
}
Exemplo n.º 13
0
void wyProgressTimer::increase(float delta) {
	float p = m_percentage + delta;
	p = MIN(100, p);
	p = MAX(0, p);
	setPercentage(p);
}
Exemplo n.º 14
0
void LDZGameLayer::initLevel(int level){
    
    Size vs = Director::getInstance()->getVisibleSize();
    Vec2 vo = Director::getInstance()->getVisibleOrigin();
    
    _mode = MODE_BEGAIN;
    
    TMXTiledMap *map = TMXTiledMap::create("back.tmx");
    _map = map;
    _mapSize = Size(map->getMapSize().width * map->getTileSize().width , map->getMapSize().height * map->getTileSize().height);
    map->setPosition(Vec2(0, 0));
    this->addChild(map);
    
    //main char
    _mainC = Sprite::createWithSpriteFrameName("1.png");
    _mainC->setPosition(_mapSize.width/2, _mainC->getContentSize().height/2 + 10);
    this->addChild(_mainC,1);
    
    //progress
    auto progress = ProgressTimer::create(Sprite::createWithSpriteFrameName("tempb.png"));
    float progx = _mapSize.width/2 - _mainC->getContentSize().width/2 - progress->getContentSize().width/2 - 5;
    float progy = _mainC->getContentSize().height/2 + 10;
    progress->setPosition( progx, progy);
    progress->setType(cocos2d::ProgressTimer::Type::BAR);
    progress->setBarChangeRate(Vec2(0, 1));
    progress->setMidpoint(Vec2(0, 0));
    auto progback = Sprite::createWithSpriteFrameName("temp.png");
    progback->setPosition(progx, progy);
    this->addChild(progback);
    this->addChild(progress,1);
    progress->setVisible(false);
    progback->setVisible(false);
    _powerProg = progress;
    _powerProgBack = progback;
    
    //limit
    float height = 50 + arc4random()%100;
    float uy = _mapSize.height/3 + _mapSize.height/3*2*CCRANDOM_0_1() - 5;
    float dy = uy - height;
    _upLimit = Sprite::createWithSpriteFrameName("limit.png");
    _upLimit->setPosition(_mapSize.width/2, uy);
    this->addChild(_upLimit);
    _downLimit = Sprite::createWithSpriteFrameName("limit.png");
    _downLimit->setPosition(_mapSize.width/2, dy);
    this->addChild(_downLimit);
    
    //guide
    auto gt = ui::Text::create(LHLocalizedCString("guidetext"), Common_Font, 25);
    gt->setColor(Color3B::RED);
    gt->setPosition(Vec2(_mainC->getPosition().x , _mainC->getBoundingBox().getMaxY() + gt->getContentSize().height/2));
    this->addChild(gt);
    auto bl = Blink::create(1, 1);
    auto rp = RepeatForever::create(bl);
    gt->runAction(rp);
    
    auto da = Sprite::create("da.png");
    da->setScaleY(height/da->getContentSize().height);
    da->setPosition(Vec2(_mainC->getPosition().x,_downLimit->getPositionY()+height/2));
    this->addChild(da);
    
    auto lis = EventListenerTouchOneByOne::create();
    lis->onTouchBegan = [this,gt,progress,progback,da](Touch* tmpTouch, Event*){
        if (_mode == MODE_VIEW) {
            Vec2 loca = tmpTouch->getLocation();
            loca = this->convertToNodeSpace(loca);
            if (_mainC->getBoundingBox().containsPoint(loca)) {
                CallFunc *call = CallFunc::create([this](){
                    _mode = MODE_POWER;
                    this->scheduleUpdate();
                    CocosDenshion::SimpleAudioEngine::getInstance()->playEffect("wiso.wav");
                });
                
                float focusMargin = 20;
                this->focusOn(_mainC->getPosition(), _mainC->getContentSize().height + focusMargin, true , call);
                _mode = MODE_BEGAIN;
                
                gt->removeFromParent();
                da->removeFromParent();
                
                progress->setVisible(true);
                progback->setVisible(true);
                progress->setPercentage(0);
            }
        }else if (_mode == MODE_POWER_END){
            _mode = MODE_POWER;
        }
        
        return true;
    };
    lis->onTouchMoved = [this](Touch* tmpTouch, Event*){
        Vec2 cu = tmpTouch->getLocation();
        Vec2 last = tmpTouch->getPreviousLocation();
        if (_mode == MODE_VIEW) {
            float toy = _focusCenter.y + (last.y - cu.y);
            if (toy+_focusLen/2 > _upLimit->getPositionY() + 20) {
                toy = _upLimit->getPositionY()+20 - _focusLen/2;
            }
            this->focusOn(Vec2(_focusCenter.x , toy),_focusLen, false);
        }else if (_mode == MODE_POWER){
            float dy = fabsf(cu.y - last.y);
            _powerProg->setPercentage(_powerProg->getPercentage()+dy/(_powerProg->getPercentage()+1)/MOVE_FACTOR);
        }
    };
    lis->onTouchEnded = [this](Touch*, Event*){
        if (_mode == MODE_POWER) {
            _mode = MODE_POWER_END;
            _powerCount = 0.1f;
        }
    };
    this->getEventDispatcher()->addEventListenerWithSceneGraphPriority(lis, this);
    
    focusOn(Vec2(_mapSize.width/2,(uy - height/2)), vs.width, false);
    auto dl2 = DelayTime::create(1);
    CallFunc *call = CallFunc::create([this](){
        auto tmpcall = CallFunc::create([this](){
            _mode = MODE_VIEW;
        });
        this->focusOn(_mainC->getPosition(), _focusLen, true , tmpcall);
    });
    auto sq = Sequence::create(dl2,call, NULL);
    this->runAction(sq);
}