What do they mean by “temporary space of the animation layer” and “in local active time”?

They say:

The synchronization protocol provides the means to start the animation the number of seconds in its duration using two properties: beginTime and offset. The beginTime value indicates the number of seconds in the duration of the animation should begin and scaled to the time interval of the animation layer. The TimeOffset function indicates an additional offset, but specified in the local active time. Both values ​​are combined to determine the final initial displacement.

I know about time frames. But it’s hard for me to understand their words here.

"scales to the temporary space of the animation layer."

Suppose I have this:

  • animator speed = 1.0
  • level of animated viewing speed = 2.0
  • super layer speed = 2.0
  • beginTime = 1.0

then it will start in real time in 0.25 seconds? (The double speed of the superlayer, which doubles the speed of the sublevel, so we have four times the speed, and the local speed of the animator is 1. so it's still the quadrant speed.).

And the Offset time is indicated "in local active time". Do they mean time distorted by speed? that is, if the speed property of the animator object is 1.0, what is the local active time?

Local active time can really mean a lot of different things to me. For example, the time of a clock or the time in the entire hierarchy of time space, as this affects the time at the bottom. It would be great if anyone could point out the details here.

+3
1

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 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 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;

, , .

+2

Source: https://habr.com/ru/post/1713292/


All Articles