他们说:



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

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

可以说我有这个:

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

  • 那么它会在 0.25 秒后实时开始吗? (双超层速度,使子层速度加倍,所以我们有四倍速度。动画师的本地速度为1。所以仍然是四倍速度。)。

    并且 timeOffset 表示“在本地事件时间”。他们的意思是被速度扭曲的时间?即如果动画对象的速度属性是 1.0,那么这里是本地事件时间?

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

    最佳答案

    查看 Core Animation 的标题;特别是 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 layer"和 "in the local active time"是什么意思?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1168979/

    10-13 06:29