iOS 动画 海水 声波 水波 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
newkengsir
V2EX    分享创造

iOS 动画 海水 声波 水波

  •  1
     
  •   newkengsir 2016-10-25 09:39:09 +08:00 3631 次点击
    这是一个创建于 3285 天前的主题,其中的信息可能已经有所发展或是发生改变。

    YSCAnimation

    demo 介绍地址:网页链接

    demo 地址

    ripple animation

    1). singlelineripple --> corresponding class YSCRippleView

    [_rippleView showWithRippleType:YSCRippleTypeLine] 

    2). ringRipple --> corresponding class YSCRippleView

    [_rippleView showWithRippleType:YSCRippleTypeRing] 

    3). cicleRipple --> corresponding class YSCRippleView

    [_rippleView showWithRippleType:YSCRippleTypeCircle] 

    4). mixedripple --> corresponding class YSCRippleView

    [_rippleView showWithRippleType:YSCRippleTypeMixed] 

    wave animation

    1). pusle --> corresponding class YSCWaveView

    [_waveView showWaveViewWithType:YSCWaveTypePulse] 

    2). wave --> corresponding class YSCWaveView

    [_waveView showWaveViewWithType:YSCWaveTypeVoice] 

    3). movedWave --> corresponding class YSCWaveView

    [_waveView showWaveViewWithType:YSCWaveTypeMovedVoice] 

    mask animation

    1). circleLoad --> corresponding class YSCCircleLoadAnimationView

    YSCCircleLoadAnimationView *shapeView = [[YSCCircleLoadAnimationView alloc] initWithFrame:self.view.bounds]; UIImage *image = [UIImage imageNamed:@"tree.jpg"]; shapeView.loadingImage.image = image; [self.view addSubview:shapeView]; [shapeView startLoading]; 

    2). microphone wave --> corresponding class YSCMicrophoneWaveView

    YSCMicrophoneWaveView *microphOneWaveView= [[YSCMicrophoneWaveView alloc] init]; [microphoneWaveView showMicrophoneWaveInParentView:self.view withFrame:self.view.bounds]; 

    3). fanshaped wave --> corresponding class YSCFanShapedView

    - (YSCFanShapedView *)fanshapedView { if (!_fanshapedView) { self.fanshapedView = [[YSCFanShapedView alloc] init]; _fanshapedView.frame = CGRectMake(0, 0, 300, 150); _fanshapedView.center = CGPointMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0 - 100); } return _fanshapedView; } //show [self.fanshapedView showInParentView:self.view WithType:YSCFanShapedShowTypeExpand]; 

    voice wave

    1). voice wave --> corresponding class YSCVoiceWaveView YSCVoiceLoadingCircleView

    //show self.voiceWaveView = [[YSCVoiceWaveView alloc] init]; [self.voiceWaveView showInParentView:self.voiceWaveParentView]; [self.voiceWaveView startVoiceWave]; //hide [self.voiceWaveView stopVoiceWaveWithShowLoadingViewCallback:^{ [self.updateVolumeTimer invalidate]; _updateVolumeTimer = nil; [self.loadingView startLoadingInParentView:self.view]; }]; 

    water wave

    1). water wave --> corresponding class YSCWaterWaveView

    - (YSCWaterWaveView *)waterWave { if (!_waterWave) { self.waterWave = [[YSCWaterWaveView alloc] init]; _waterWave.frame = CGRectMake(0, 0, self.view.bounds.size.width, 300); _waterWave.percent = 0.6; _waterWave.firstWaveColor = [UIColor colorWithRed:146/255.0 green:148/255.0 blue:216/255.0 alpha:1.0]; _waterWave.secOndWaveColor= [UIColor colorWithRed:84/255.0 green:87/255.0 blue:197/255.0 alpha:1.0]; } return _waterWave; } //show [self.view addSubview:self.waterWave]; [self.waterWave startWave]; 

    seawater wave

    1). seawater wave --> corresponding class YSCSeaGLView tip: it should not run in simulator

    self.seaGLView = [[YSCSeaGLView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)]; [self.view addSubview:_seaGLView]; //hide - (void)viewDidDisappear:(BOOL)animated { [_seaGLView removeFromParent]; _seaGLView = nil; } 

    emitter animation

    1). fire --> corresponding class YSCFireViewController

    - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.view.backgroundColor=[UIColor whiteColor]; //设置发射器 _fireEmitter=[[CAEmitterLayer alloc] init]; _fireEmitter.emitterPosition=CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height-20); _fireEmitter.emitterSize=CGSizeMake(self.view.frame.size.width-100, 20); _fireEmitter.renderMode = kCAEmitterLayerAdditive; //发射单元 //火焰 CAEmitterCell *fire = [CAEmitterCell emitterCell]; fire.birthRate=800; fire.lifetime=2.0; fire.lifetimeRange=1.5; fire.color=[[UIColor colorWithRed:0.8 green:0.4 blue:0.2 alpha:0.1] CGColor]; fire.cOntents=(id)[[UIImage imageNamed:@"fire"] CGImage]; [fire setName:@"fire"]; fire.velocity=160; fire.velocityRange=80; fire.emissiOnLongitude=M_PI+M_PI_2; fire.emissiOnRange=M_PI_2; fire.scaleSpeed=0.3; fire.spin=0.2; fire.alphaSpeed = -0.05; //烟雾 CAEmitterCell *smoke = [CAEmitterCell emitterCell]; smoke.birthRate=400; smoke.lifetime=3.0; smoke.lifetimeRange=1.5; smoke.color=[[UIColor colorWithRed:1 green:1 blue:1 alpha:0.05] CGColor]; smoke.cOntents=(id)[[UIImage imageNamed:@"fire"] CGImage]; [smoke setName:@"smoke"]; smoke.velocity=250; smoke.velocityRange=100; smoke.emissiOnLongitude=M_PI+M_PI_2; smoke.emissiOnRange=M_PI_2; smoke.alphaSpeed = -0.05; _fireEmitter.emitterCells=[NSArray arrayWithObjects:smoke, fire,nil]; [self.view.layer addSublayer:_fireEmitter]; } 

    2). butterfly --> corresponding class YSCButterflyViewController

    - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.view.backgroundColor=[UIColor whiteColor]; //emitter _butterflyEmitter=[[CAEmitterLayer alloc] init]; _butterflyEmitter.emitterPosition=CGPointMake(self.view.frame.size.width/2,self.view.frame.size.height-20); _butterflyEmitter.emitterSize=CGSizeMake(self.view.frame.size.width-100, 20); _butterflyEmitter.renderMode = kCAEmitterLayerUnordered; _butterflyEmitter.emitterShape = kCAEmitterLayerCuboid; _butterflyEmitter.emitterDepth = 10; _butterflyEmitter.preservesDepth = YES; //cells //blue butterfly CAEmitterCell *blueButterfly = [CAEmitterCell emitterCell]; blueButterfly.birthRate=8; lueButterfly.lifetime=5.0; blueButterfly.lifetimeRange=1.5; blueButterfly.color=[[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.1] CGColor]; blueButterfly.cOntents=(id)[[UIImage imageNamed:@"butterfly1"] CGImage]; [blueButterfly setName:@"blueButterfly"]; blueButterfly.velocity=160; blueButterfly.velocityRange=80; blueButterfly.emissiOnLongitude=M_PI+M_PI_2; blueButterfly.emissiOnLatitude= M_PI+M_PI_2; blueButterfly.emissiOnRange=M_PI_2; blueButterfly.scaleSpeed=0.3; blueButterfly.spin=0.2; blueButterfly.alphaSpeed = 0.2; //yellow butterfly CAEmitterCell *yellowButterfly = [CAEmitterCell emitterCell]; yellowButterfly.birthRate=4; yellowButterfly.lifetime=5.0; yellowButterfly.lifetimeRange=1.5; yellowButterfly.color=[[UIColor colorWithRed:1 green:1 blue:1 alpha:0.05] CGColor]; yellowButterfly.cOntents=(id)[[UIImage imageNamed:@"butterfly2"] CGImage]; [yellowButterfly setName:@"yellowButterfly"]; yellowButterfly.velocity=250; yellowButterfly.velocityRange=100; yellowButterfly.emissiOnLongitude=M_PI+M_PI_2; yellowButterfly.emissiOnLatitude= M_PI+M_PI_2; yellowButterfly.emissiOnRange=M_PI_2; yellowButterfly.alphaSpeed = 0.2; yellowButterfly.scaleSpeed=0.3; yellowButterfly.spin=0.2; _butterflyEmitter.emitterCells=[NSArray arrayWithObjects:yellowButterfly, blueButterfly,nil]; [self.view.layer addSublayer:_butterflyEmitter]; } 

    repicator animation

    1). matrixCircle --> corresponding class YSCMatrixCircleAnimationView

    self.matrixCircleView = [[YSCMatrixCircleAnimationView alloc] initWithFrame:CGRectMake(0, 0, 300, 300) xNum:8 yNum:8]; _matrixCircleView.center = CGPointMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0); [self.view addSubview:_matrixCircleView]; 

    2). circle ripple --> corresponding class YSCCircleRippleView

    self.rippleView = [[YSCCircleRippleView alloc] initWithFrame:CGRectMake(0, 0, 300, 300)]; _rippleView.center = CGPointMake(self.view.bounds.size.width / 2.0, self.view.bounds.size.height / 2.0); [self.view addSubview:_rippleView]; _rippleView.backgroundColor = [[UIColor greenColor] colorWithAlphaComponent:0.4]; [_rippleView startAnimation]; 

    9 条回复    2016-10-27 17:30:08 +08:00
    xsxsxszs
        1
    xsxsxszs  
       2016-10-25 10:25:41 +08:00 via iPhone
    赞一个
    NanRuoSi
        2
    NanRuoSi  
       2016-10-25 10:30:19 +08:00
    赞一个 +1
    xsxsxszs
        3
    xsxsxszs  
       2016-10-25 11:33:36 +08:00 via iPhone
    海水那个太像拍出来的了
    junyixin
        4
    junyixin  
       2016-10-25 12:35:53 +08:00
    赞一个~
    xi_lin
        5
    xi_lin  
       2016-10-25 12:45:00 +08:00
    水波效果是好啊
    cquzc
        6
    cquzc  
       2016-10-25 12:55:15 +08:00 via iPhone
    想到了 Surge 运行时的动画
    samingzhong
        7
    samingzhong  
       2016-10-26 11:50:36 +08:00
    Shared
        8
    Shared  
       2016-10-27 13:44:33 +08:00
    前面几个感觉一样,但是后面的动画效果非常好
    fhefh
        9
    fhefh  
       2016-10-27 17:30:08 +08:00
    nice
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     3323 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 04:40 PVG 12:40 LAX 21:40 JFK 00:40
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86