HTML5 Canvas 3D WebGL (TM) javaScript Library
 

onTerm Library Method

Signature: x.onTerm ()
Class: transform_Controller Class
 

Is a hook that is called immediately before terminating the transform controller. The following example assigns a function that function(){taccgl.stop)}; that in turn terminates the animation as well.

Examples

var a=taccgl.actor("testimg").useTM().dur(3000).start();
taccgl.actor("Middle").showAfter().start();
taccgl.actor("MenuBar").showAfter().start();
taccgl.useController(taccgl.transformController());
taccgl.controller.onTerm=function(){taccgl.stop()};
taccgl.start();
RUN
taccgl.a("Middle").showAfter().blend(0,0).color("white").shadowOnly().start();
taccgl.a("MenuBar").shadowOnly().blend(0,0).color("white").showAfter().start();
var a=taccgl.actor("testimg").useTM().dur(3000).start();
taccgl.useController(taccgl.transformController());
taccgl.controller.onTerm=function(){taccgl.stop(); taccgl.TM=taccgl.m44I();};
taccgl.start();
RUN

The second example above resets the transformation matrix using taccgl.TM=taccgl.m44I() which makes a second run of the example start from the initial position.

WebGL™ is a trademark of the Khronos Group Inc.