zoukankan      html  css  js  c++  java
  • 间隔动作函数

    void MyAction::goMenu(Ref* pSender)
    {   
    	log("Tag = %i",this->getTag());
    	Size size = Director::getInstance()->getVisibleSize();
    
    	ccBezierConfig bezier;
    
    	switch (this->getTag()) {
    	case kMoveTo:
    		sprite->runAction(MoveTo::create(2,Vec2(size.width - 50, size.height - 50)));
    		break;
    	case kMoveBy:
    		sprite->runAction(MoveBy::create(2,Vec2(-50, -50)));
    		break;
    	case kJumpTo:
    		sprite->runAction(JumpTo::create(2,Vec2(150, 50),30,5));
    		break;
    	case kJumpBy:
    		sprite->runAction(JumpBy::create(2,Vec2(100, 100),30,5));
    		break;
    	case kBezierBy:
    		bezier.controlPoint_1 = Vec2(0, size.height/2);
    		bezier.controlPoint_2 = Vec2(300, -size.height/2);
    		bezier.endPosition = Vec2(100,100);
    		sprite->runAction(BezierBy::create(3,bezier));
    		break;
    	case kScaleTo:
    		sprite->runAction(ScaleTo::create(2, 4));
    		break;
    	case kScaleBy:
    		sprite->runAction(ScaleBy::create(2, 0.5));
    		break;
    	case kRotateTo:
    		sprite->runAction(RotateTo::create(2,180));
    		break;
    	case kRotateBy:
    		sprite->runAction(RotateBy::create(2,-180));
    		break;
    	case kBlink:
    		sprite->runAction(Blink::create(3, 5));
    		break;
    	case kTintTo:
    		sprite->runAction(TintTo::create(2, 255, 0, 0));
    		break;
    	case kTintBy:
    		sprite->runAction(TintBy::create(0.5,0, 255, 255));
    		break;
    	case kFadeTo:
    		sprite->runAction(FadeTo::create(1, 80));
    		break;
    	case kFadeIn:
    		sprite->setOpacity(10);
    		sprite->runAction(FadeIn::create(1));
    		break;
    	case kFadeOut:
    		sprite->runAction(FadeOut::create(1));
    		break;
    	default:
    		break;
    	}
    }

  • 相关阅读:
    winform右键菜单
    IIS添加映射配置
    linux+nginx+python+django环境配置
    ASP.NET获取客户端IP地址
    Ext未定义问题解决
    c#获取硬件信息
    DevExpress GridControl使用方法总结
    CDN技术原理
    Mac搭建nginx+rtmp服务器
    MAXOS安装FFMPEG
  • 原文地址:https://www.cnblogs.com/Anzhongliu/p/6091941.html
Copyright © 2011-2022 走看看