Canvas Library
 

clipFrom Library Method

Short Description: Animate Clipping - Set Rectangular Starting Point

Signature: t.clipFrom (x,y,w,h) or (l,b)
Group: Shape
Class: transition Class
 
Sample HTML Element containing some text.

The parameters have the same meaning as with clip. The methods sets the starting point of a clipping animation.

A clipping animation at the begin clips a certain part of the element and at the end another part. Both are set with clipFrom and clipTo. If either is missing, it defaults to the complete element or the part previously selected e.g. with clip.

w or h should not be set to 0 because then the calculation of surface normals and lighting do not work. Therefore the examples below use w=1 or h=1. The third example uses 0 anyway and you will notice that the animated element appears too dark.

taccgl.actor("htmlel5").clipFrom ({},1,1) . dur(3). start();
RUN
taccgl.actor("htmlel5").clipFrom ({rx:1},1,1) . dur(3). start();
RUN
taccgl.actor("htmlel5").clipFrom ({},0,0) . dur(3). start();
RUN
taccgl.actor("htmlel5").clipFrom ({}, {rx:0.5,ry:1}).clipTo ({rx:0.5}, {rx:1,ry:1}) . dur(3). start();
RUN
taccgl.actor("htmlel5").clipFrom ({rx:-0.5}, {rx:0,ry:1}).clipTo ({rx:1}, {rx:1.5,ry:1}) . dur(3). start();
RUN

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.clipTo - Animate Clipping - Set Rectangular End Point
Previous Page: transition.restrict - Select / Clip-To Rectangular Part (depricated name for clip)