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.
分享到:
相关推荐
一本介绍如何使用开源3D动画软件Blender制作角色动画的资料。很不错。
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第二版英文清晰文字版
Sybex.Introducing.Character.Animation.with.Blender.2nd.Edition
The Cocoa Environment 13 Introducing Cocoa 13 How Cocoa Fits into Mac OS X 14 How Cocoa Fits into iOS 16 Features of a Cocoa Application 18 The Development Environment 21 Platform SDKs 21 Overview of ...
erlang入门电子书 erlang编程 Introducing Erlang,作者Simon.St.Laurent
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 you’ll examine new Windows 7 capabilities and get a head start exploiting them to build better user experiences and applications. Topics include multi-touch ...
Introducing Regular Expressions pdf 高清 有目錄
introducing social networks
Introducing Visual C# 2010.pdf
Microsoft.Press.Introducing.Windows.7.for.Developers
Introducing Microsoft Flow pdf Use Microsoft Flow in your business to improve productivity through automation with this step-by-step introductory text from a Microsoft Flow expert. You’ll see the ...
《Introducing Visual C# 2010》Source Code Delivery
introducing-java-8.pdf 不可多得的好书 你值得拥有
Introducing Bluetooth LE Audio book form Bluetooth SIG
Introducing MySQL Shell
Introducing.Go.2016.1.pdf
Introducing Power BI
Introducing Linux Distros teaches you the pros and the cons of the most frequently used distros in order to find the one that is right for you. You will explore each distro step by step, so that you ...