HTML5 Canvas 3D WebGL (TM) javaScript Library
 

resize Library Method

Short Description: Change or Animate Size of Object

Signature: t.resize ([w],[h],[w1],[h1])
Group: Shape
Class: transition Class
 

Resizes or shows an animation growing or shrinking the animated object. If just w and h are specified the object is resized, otherwise an animation is shown growing or shrinking the animated object from width and height (w0,h0) to (w1,h1).

If w or h or both are not given (e.g. null) then the animation starts with the default width or height or both of the object and grows or shrinks to w1 and h1. If w and w1 are not given then the function only effects the height vector(s) and if h and h1 are not given only the width vectors.

Examples

var a=taccgl.actor("testimg"); a.resize(100,100).start();
RUN
var a=taccgl.actor("testimg"); a.resize(0,0,a.w,a.h).start();
RUN
var a=taccgl.actor("testimg"); a.resize(a.w,a.h,0,0).start();
RUN
var a=taccgl.actor("testimg"); a.hVTo(-1,1,0).wVTo(1,1,0).resize(a.w,a.h).start()
.cont().resize(null,null,a.w/2,a.h/2).start()
.cont().resize(null,null,a.w,a.h).start();
RUN

It is very useful to use resize after hV or wV. In that event the function keeps the direction of the height and width vectors and just adjusts the size(s). hV, wV, hVTo, or wVTo should not be used after resize.

For adjusting/animating in 3D see depth.

WebGL™ is a trademark of the Khronos Group Inc.

Next Page:transition.depth - Set or Animate Depth of Object
Previous Page: Shape