HTML5 Canvas 3D Animation Library
 

mapT Library Method

Short Description: Map portion of texture canvas

Signature: t.mapT (s,t,ws,wt,hs,ht) or (b,l,r)
Group: Texture
Class: transition Class
 
almost empty element with id="ex10"

Maps a portion of the Texture Canvas as texture on to the animated object. (s,t) specify the coordinates of the top left point of the portion. (ws,wt) is the width and (hs,ht) the height given in vector form, i.e. (s+ws,t+wt) is the top right point and (s+hs, t+ht) the bottom left point of the texture. This is an extension of map for non-rectangular textures.

Alternatively the vectors (s,t),(ws,wt), and (hs,ht) can be given using a Position Specification. that will be resolved into coordinates.

Examples

var a=taccgl.actor("testimg"); taccgl.a("ex10").mapT(a.x,a.y,a.w,0,0,a.h).start();
RUN
var a=taccgl.actor("testimg"); taccgl.a("ex10").mapT(a.x,a.y,a.w,0,0,a.h/2).start();
RUN
var a=taccgl.actor("testimg"); taccgl.a("ex10").mapT(a.x,a.y,a.w,20,0,a.h-20).start();
RUN
var a=taccgl.actor("testimg"); taccgl.a("ex10").mapT(a.x,a.y,0,a.h,a.w,0).start();
RUN
var a=taccgl.actor("testimg"), e=taccgl.a("ex10"); e.mapT(a.x,a.y,0,e.w,e.h,0).start();
RUN
taccgl.a("testimg").paint();
taccgl.a("ex10").mapT({el:"testimg"},{el:"testimg",ex:1},{el:"testimg",ey:1}).start();
RUN
taccgl.a("testimg").paint();
taccgl.a("ex10").mapT({el:"testimg",ex:1},{el:"testimg"},{el:"testimg",ex:1,ey:1}).start();
RUN
taccgl.a("testimg").paint();
taccgl.a("ex10").mapT({el:"testimg"},{el:"testimg",ey:1},{el:"testimg",ex:0.3}).start();
RUN

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.mapTFrom - Animate mapped portion of texture canvas
Previous Page: transition.mapFrom - Animate mapped rectangular portion of texture canvas