gpt4 book ai didi

iphone - "the timespace of the animation' s层”和 "in the local active time"是什么意思?

转载 作者:行者123 更新时间:2023-12-03 20:02:44 24 4
gpt4 key购买 nike

他们说:

The timing protocol provides the means of starting an animation a certain number of seconds into its duration using two properties: beginTime and timeOffset. The beginTime specifies the number of seconds into the duration the animation should start and is scaled to the timespace of the animation's layer. The timeOffset specifies an additional offset, but is stated in the local active time. Both values are combined to determine the final starting offset.

我了解时空。但我在这里很难理解他们的话。

“缩放到动画层的时间空间。”

假设我有这个:

  • 动画师速度 = 1.0
  • 动画 View 层的速度 = 2.0
  • super 层的速度 = 2.0
  • 开始时间 = 1.0

那么0.25秒后就会实时开始? (双倍 super 层速度,双倍子层速度,因此我们有四倍速度。动画师的本地速度为 1。所以仍然是四倍速度。)。

并且 timeOffset 被规定为“以本地事件时间”。他们的意思是被速度扭曲的时间?即,如果动画器对象的速度属性为 1.0,这就是此处的本地事件时间?

本地活跃时间对我来说确实意味着很多不同的事情。例如时钟时间,或者整个时空层次结构中的时间,它如何影响底部的时间。如果有人能在这里指出详细信息,那就太好了。

最佳答案

查看核心动画的标题;特别是CAMediaTiming.h:

/* The CAMediaTiming protocol is implemented by layers and animations, it
* models a hierarchical timing system, with each object describing the
* mapping from time values in the object's parent to local time.
*
* Absolute time is defined as mach time converted to seconds. The
* CACurrentMediaTime function is provided as a convenience for querying the
* current absolute time.
*
* The conversion from parent time to local time has two stages:
*
* 1. conversion to "active local time". This includes the point at
* which the object appears in the parent's timeline, and how fast it
* plays relative to the parent.
*
* 2. conversion from active to "basic local time". The timing model
* allows for objects to repeat their basic duration multiple times,
* and optionally to play backwards before repeating. */

此外(来自属性的评论)

/* The rate of the layer. Used to scale parent time to local time, e.g.
* if rate is 2, local time progresses twice as fast as parent time.
* Defaults to 1. */

@property float speed;

/* Additional offset in active local time. i.e. to convert from parent
* time tp to active local time t: t = (tp - begin) * speed + offset.
* One use of this is to "pause" a layer by setting `speed' to zero and
* `offset' to a suitable value. Defaults to 0. */

@property CFTimeInterval timeOffset;

所以,看来你的解释是正确的。

关于iphone - "the timespace of the animation' s层”和 "in the local active time"是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1168979/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com