`

Introducing Cocoa Animation

阅读更多

Smooth Moves

 

you first ask mover for its animator, and you then send setFrame: to that instead. 

 

- (void)move {
     if(isRight) {
         [[mover animator] setFrame:leftFramePosition];
      } else {
         [[mover animator] setFrame:rightFramePosition];
      }
     isRight = !isRight;
}

 

 

animator:

The image now smoothly animates between its initial state
and the docked state.

 

Animation with no threads and no synchronization!

 

 

 

 

二:Animation and the Animator Proxy

 

Finding Animations

 

写道
First it calls the animationForKey: method with the key that is being changed (in our example frame would be used). animationForKey:
first looks in the receiver’s animations dictionary, and if an
animation is found, it is returned. (We will eventually be adding custom
animations to this dictionary in Chapter 3, Animation Types, on
page 28.) If not, then the class method defaultAnimationForKey: is called,
and that animation is returned. The proxy then invokes the animation,
which in turn animates the change for the property.
If nil is returned from animationForKey:, then the change in the property
is not animated; instead, the value is simply passed to the underlying
object.

 

 

The default animation is a CABasicAnimation that does a basic linear
interpolation between the fromValue and the toValue. By default, the
current value of the changing property is used as the from value, and
the new value is used as the toValue for the animation. The animator
then passes responsibility to an instance of CAAnimation for doing the
interpolation between the fromValue and toValue and animating these
changes.

 

 

三:Animation and Interpolation

 

写道
The default interpolation is a straight line that starts at time zero and fromValue and finishes at the end time and toValue.

 

 

 

Something important to keep in mind here is that Core Animation is time-based, not frame-based.

 

 

分享到:
评论

相关推荐

    Introducing Character Animation with Blender

    ### 使用Blender进行角色动画制作的关键知识点 #### 一、Blender概述与应用领域 - **Blender**:是一款开源的3D创作软件,适用于3D建模、动画、渲染等多个方面,尤其在角色动画制作方面表现突出。...

    Introducing Character Animation with Blender 2nd Edition April 2011

    Introducing Character Animation with Blender, 2nd Edition is written in a friendly but professional tone, with clear descriptions and numerous illustrative screenshots. Throughout the book, tutorials ...

    Sybex.Introducing.Character.Animation.with.Blender.2nd.Edition

    Sybex.Introducing.Character.Animation.with.Blender.2nd.Edition

    Introducing Character Animation with Blender 第二版

    ### Introducing Character Animation with Blender 第二版 #### Blender 基础:界面与对象 - **工作区域与窗口类型**:Blender 提供了多种不同的工作区和窗口类型,每种都有其特定的功能。例如,3D 视图窗口允许...

    Introducing.JavaFX.8.Programming.0071842551.epub

    Introducing JavaFX 8 Programming provides a fast-paced, practical introduction to JavaFX, Java’s next-generation GUI programming framework. In this easy-to-read guide, best-selling author Herb ...

    Introducing Windows 7 for Developers (pdf)

    为了帮助开发者更好地理解并利用这一新平台的功能,《Introducing Windows 7 for Developers》一书应运而生。本书由Yochay Kiriaty、Laurence Moroney、Sasha Goldshtein 和 Alon Fliess 共同编写,并由Microsoft ...

    erlang编程 Introducing Erlang

    **Erlang编程:Introducing Erlang** Erlang是一种函数式编程语言,由爱立信在1986年开发,主要用于构建高可用性、容错性和并发性的分布式系统。"Introducing Erlang"是Simon St. Laurent撰写的一本入门级教程,...

    introducing_eventstorming.pdf

    这本书《Introducing EventStorming》由Alberto Brandolini撰写,介绍了事件风暴技术的具体应用方法和案例,适合于对领域驱动设计(DDD)和大型系统建模感兴趣的读者。 事件风暴工作坊通常包括以下几个阶段: 1. ...

    Introducing.Python英文文字版

    《Introducing Python》是一本广泛认可的Python编程入门书籍,英文版提供了全面而深入的Python语言教程。这本书适合初学者,也对有一定经验的程序员有很高的参考价值。它覆盖了Python的基础语法、核心概念以及一些...

    introducing-java-8.pdf

    Java 8 是Java编程语言的一个重要更新版本,由Raoul-Gabriel Urma所著的《Introducing Java 8》是一本介绍Java 8新特性的指南书。本书提供了Java 8中新增的Lambda表达式和流(Streams)的快速入门,旨在帮助程序员...

    Introducing Visual C# 2010随书代码

    《Introducing Visual C# 2010》是面向初学者和中级程序员的一本经典教程,旨在引导读者深入了解Visual C# 2010编程语言及其相关开发工具。随书附带的源代码是为了帮助读者更好地理解书中的示例和实践项目,以便于将...

    Introducing Visual C# 2010

    《Introducing Visual C# 2010》是关于C#编程语言的一份详细指南,主要针对Visual Studio 2010版本。这本书深入浅出地介绍了C#的基础概念、语法以及在实际开发中的应用。C#是微软公司推出的面向对象的编程语言,广泛...

    Introducing Bootstrap 4 无水印pdf

    Introducing Bootstrap 4 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或...

    Introducing Erlang Getting Started in Functional Programming(2nd) epub

    Introducing Erlang Getting Started in Functional Programming(2nd) 英文epub 第2版 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

Global site tag (gtag.js) - Google Analytics