TimeContext in Anark Studio 2.5

Time context for objects in the scene or component.

Inherits from:

Instance Properties

name type description
constructor Object A reference to the constructor class for the current object instance. [from Object]
contextTime Number Current time of the context.
jumpTime Number Total time length.
jumpTo Number Time to return to when looping.
maxTime Number Ending time of the context.
minTime Number Starting time of the context.
paused Boolean (read only) Is the context paused?
prototype Object The prototype for a class. [from Object]
rate Number Playback speed.

Instance Methods

name returns description
hasOwnProperty(propertyOrMethodName) Boolean Determines if the object/instance itself has the named property or method. [from Object]
isPrototypeOf(instanceToTest) Boolean Determines if the calling object prototype is in the inheritance chain for the supplied argument. [from Object]
pause() (none) Pause playback.
play() (none) Resume playback.
propertyIsEnumerable(propertyOrMethodName) Boolean Determines if the object/instance itself has a property or method of the supplied name which will appear in a for (prop in obj) enumeration. [from Object]
toLocaleString() String For most objects, the same as toString() unless explicitly overridden. [from Object]
toString() String Returns a string representation of the object. [from Object]
valueOf() String Returns the internal this value of the object. [from Object]


The TimeContext object provides the time context for the objects inside a component. Components are parent containers for one or more objects that are assigned an independent timer in the scene.

A project has a clock that controls the timing of actions for the objects in the scene. This clock provides the objects with a time context. Each time a new frame is generated, the objects in the scene ask their time context "what time is it?" and then determine what state they need to be in based in part on that information. Anark Studio also provides independent timelines that allow you to create a separate time context for a particular group of objects. The time context can be repeated either by looping back to the beginning or by "ping-ponging" between moving forward or backward. Components simplify the process of creating repetitive animations and interactive behaviors such as buttons and menu systems. Components can even be nested inside other components.

Components can only be created using the Anark Studio interface. The TimeContext object has no constructor because it is always available as the context property of any asset.

TimeContext Examples

// If the timeIndependent variable is true, then set the currentTime to be the CPU time.
// Otherwise, set the currentTime to the time context of the Behavior object.  
function onUpdate()
	var currentTime;  
	if (this.timeIndependent){
		currentTime = scene.presentation.realTime;  
		currentTime = this.context.contextTime;  

Properties that are a TimeContext

name object description
context Asset (read only) The asset's local TimeContext object.

Methods that return a TimeContext

name of object description
getContext(timeContextName) Presentation Get a TimeContext by name.