Tag: 核心animation

IOS – 多个图像缓慢向上的animation

我是IOS编程新手。 我想要的是我想显示多个图像,然后他们不断向上,然后重复一遍又一遍循环。 我怎样才能做到这一点 ? 我有总共8个图像,我想要这样展示 我不知道如何添加8个图像,然后他们向上的方向,不断重复。 请在这帮助我。 如果有任何相关的教程,然后请分享

如何用定时器重复调用一个方法(重新加载…)来为一个转换设置animation

我在我的xcode项目中实现了corePlot 。 我试图用animation“爆炸”饼图的一部分。 这是我正在使用的方法: – (void)radialOffsetForPieChart:(CPTPieChart *)pieChart recordIndex:(NSUInteger)idx { if (myIndex == idx) { return 20; } return 0; } 我有另一种方法调用[pieChart reloadRadialOffset]; 。 例如: – (void)thisMethod { [pieChart reloadRadialOffset]; } 我如何animationreloadRadialOffsets ?

SpriteKit纹理不可见

我正在开发一个游戏,其中有一些animation的angular色,当用户使用游戏控制进行移动,战斗时等等。 有一个正常的状态,即当用户没有触摸任何控件时,玩家的angular色纹理被分配到正常状态或静止状态纹理。 如果用户非常快速地执行这些控制,则当他回到正常状态时,玩家的angular色纹理消失。 如果使用了任何控件,那么animation是可见的。 任何人都可以帮我解决这个问题吗? 任何帮助将不胜感激。 我已经展示了我在下面使用的一些基本的编程结构。 //————————————————————————- *// The 'Normal or Resting' state texture.* SKAction *normalStateAction = [SKAction setTexture:normalStateTexture]; *// To Play any Character Animation like Walk, Fight, Jump, etc.* [playerCharacter.sprite runAction:[SKAction sequence:@[charAnimAction,normalStateAction]]]; *// In the 'TouchesEnded' method for any Game Control.* -(void)TouchesEnded { // Remove previous actions. [playerCharacter.sprite removeAllActions]; // Run Normal State […]

内部编译器错误:总线错误:10

我写了一个animation的代码,在屏幕上晃动一个UIImageView,但虽然语法看起来是正确的,但是在构build时,我却遇到了一个模糊的“ internal compiler error: Bus error: 10 ”。 任何想法为什么? -(IBAction)shakeCircle{ int d = 3; [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x+d, myCircle.center.yd);} completion:^(BOOL finished){ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.xd, myCircle.center.y+d);} completion:^(BOOL finished) { //but if I comment from here.. [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.x+d, myCircle.center.yd);} completion:^(BOOL finished){ [UIView animateWithDuration:0.05 animations:^{myCircle.center = CGPointMake(myCircle.center.xd, myCircle.center.y+d);} ]; } ]; //… […]

使用90%CPU的UIViewanimation

您好我有animation循环,但正在使用我的iPhone CPU处理的90%,正在加热手机。 我做错了什么? 有人可以给我一些build议吗? 谢谢 -(void)nextAnimation:(float)previousWidth { //picture loop imageViewTop.image = imageViewBottom.image; imageViewBottom.image = [imageArray objectAtIndex:[imageArray count] – 1]; [imageArray insertObject:imageViewBottom.image atIndex:0]; [imageArray removeLastObject]; imageViewTop.alpha = 1.0; imageViewBottom.alpha = 0.0; [UIView animateWithDuration:4.0 animations:^{ imageViewTop.alpha = 0.0; imageViewBottom.alpha = 1.0; } completion:^(BOOL completed){ [self nextAnimation:stringsize.width]; } ];

UIView animateWithDuration在iOS 8中performance有所不同

我刚刚从iOS 7.1切换到了iOS 8.1。 我遇到以下UIView animateWithDuration问题。 图片胜过千言万语,我制作了每个iOS下的行为video: iOS 7.1: iOS 8.1: 这是一个iPhone应用程序。 我应该注意到,在发布之前,我已经search了SO和其他地方。 这似乎是一个公认的问题,但是我发现有一些“使用基于约束的animation”(我不明白),closures了自动布局,但没有真正的共识。 我尝试了几次刺,但没有得到。 如果有人能指出我(或通过一个明确的解决办法),我真的很感激。 我应该提到的是,应用程序的目的只是在肖像位置,所以我没有想到在开发过程中的自动布局。 所有涉及的视图都是以编程方式创build的,除了滚动条本身。 这是代码。 我包括了很长的整个方法,但是我真的不明白在新的iOS中已经发生了什么变化,所以在安全方面。 animateWithDuration调用非常深入到块中: -(void) displayDayChart { [self.scroller setBackgroundColor:[UIColor clearColor]]; UIImage *image = [UIImage imageNamed:@"GrayPaper.png"]; self.chartView.backgroundColor = [UIColor colorWithPatternImage:image]; [self.view addSubview:self.scroller]; [self.scroller setScrollEnabled:YES]; [self.scroller setContentSize:CGSizeMake(320, 1800)]; [self.scroller setContentOffset:CGPointMake(0.0, 0.0) animated:YES]; dayBarArray = [[NSMutableArray alloc]init]; infoLabelArray = [[NSMutableArray alloc]init]; timeLabelArray […]

围绕一个锚点旋转一个精灵

我有一个精灵: ombreoeuf1 = [CCSprite spriteWithFile:@"mangeurcentremieu3_03.png" ]; ombreoeuf1.position = ccp(240,160); [self addChild:ombreoeuf1]; 我想旋转它不断围绕一个锚点。 我该怎么做?

带有AVAudioPlayer的SKEmiterNode用于音乐视觉效果

请有人帮助! 我希望使用AVAudioPlayer将我的SKEmiterNode的音阶(意义上的大小)变得越来越小。 现在这几乎是我所有的SKEmiterNode,它看起来很棒: beatParticle?.position = CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.5) var beatParticleEffectNode = SKEffectNode() beatParticleEffectNode.addChild(beatParticle!) self.addChild(beatParticleEffectNode) 所有的外观都在.sks文件中完成。 这里是我在一个连续循环中称之为“updateBeatParticle”函数的地方,这样它就可以把我的代码放在音乐上,使得粒子的尺度(意思是尺寸)越来越小。 var dpLink : CADisplayLink? dpLink = CADisplayLink(target: self, selector: "updateBeatParticle") dpLink?.addToRunLoop(NSRunLoop.currentRunLoop(), forMode: NSRunLoopCommonModes) func updateBeatParticle(){ //Put code here } 任何想法我可以做到这一点? 我看了一些这样的教程: https : //www.raywenderlich.com/36475/how-to-make-a-music-visualizer-in-ios 但是,我不能很好的理解它,因为他们使用的是一个emitterLayer,它在Obj-C中,并且对于其他的精彩人物也有兴趣。

Poptorootview控制器与延迟

我有一个方法“testing”,执行poptorootviewcontroller。 我想在poptorootviewcontroller的animation之前放一些延迟。 这是我的代码: -(void)test{ [UIView animateWithDuration:5.0 delay: 2.5 options: UIViewAnimationOptionCurveEaseIn animations:^{ [self.navigationController popToRootViewControllerAnimated:NO]; } completion:nil]; } 但它不起作用。 任何帮助? 谢谢!

Swift:如何启用CALayer的捏缩放?

我一直在试图滚动和缩放几个多边形path的CALayer,特别是CAShapeLayer。 我将CALayer添加到已成功启用CALayer滚动的UIScrollView。 但是,捏缩放不能正常工作。 有几个教程已经实现了使用UIScrollViewDelegate缩放UIImageView,就像这样: @IBOutlet var scrollView : UIScrollView! var imageView = UIImageView() scrollView.addSubview(imageView) func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? { return imageView } 但CALayer与UIView不兼容,我没有find任何有关调和差异的信息。 有没有一种类似的本地方式来缩放在雪花CALayer? 这件事真的很简单吗? 任何帮助,将不胜感激; 道歉,如果我错过了显而易见的。