Functions / getRect
getRect('poor')
getRect( )
getRect(string 'poor')
getRect(string 'coords')

Returns object with x, y, width and height of rectangle, which contains the jCanvaScript object.
getRect( )
return: object
Code
<script type="text/javascript">	
	function start_1(idCanvas)	
	{
		var x=(0.5-Math.random())*100;
		var y=(0.5-Math.random())*100;
		var myrect=jc('#myRect_1')
			.translate(x,y)
			.rotate(x,'center')
		jc.start(idCanvas);
		var rect=myrect.getRect();	
		jc('#rect_1')
			.animate({x:rect.x, y: rect.y, width: rect.width, height: rect.height});
	}
	function stop_1(idCanvas)
	{
		jc.clear(idCanvas);
		onload_1(idCanvas);
	}	
	function onload_1(idCanvas)
	{
		jc.start(idCanvas,true);
		jc.rect(100,120,50,20,'#ff0000',true)
			.id('myRect_1');
		jc.rect().id('rect_1');
	}
</script>
<canvas id="canvas_1" width="250px" height="265px"></canvas>
View
getRect(string 'poor')
return:
Code
<script type="text/javascript">	
	function start_2(idCanvas)	
	{
		var x=(0.5-Math.random())*100;
		var y=(0.5-Math.random())*100;
		var myrect=jc('#myRect_2')
			.rotate(x,'center')
			.translate(x,y);
		jc.start(idCanvas);
		var rect=myrect.getRect('poor');	
		jc('#rect_2')
			.animate({x:rect.x, y: rect.y, width: rect.width, height: rect.height});
	}
	function stop_2(idCanvas)
	{
		jc.clear(idCanvas);
		onload_2(idCanvas);
	}	
	function onload_2(idCanvas)
	{
		jc.start(idCanvas,true);
		jc.rect(100,120,50,20,'#ff0000',true)
			.id('myRect_2');
		jc.rect().id('rect_2');
	}
</script>
<canvas id="canvas_2" width="250px" height="265px"></canvas>
View
getRect(string 'coords')
return: object
Code
<script type="text/javascript">	
	function start_3(idCanvas)	
	{
		var x=(0.5-Math.random())*100;
		var y=(0.5-Math.random())*100;
		var myrect=jc('#myRect_3')
			.rotate(x,'center')
			.translate(x,y);
		jc.start(idCanvas);
		var rect=myrect.getRect('coords');	
		jc('#rect_3')
			.points(rect);
	}
	function stop_3(idCanvas)
	{
		jc.clear(idCanvas);
		onload_3(idCanvas);
	}	
	function onload_3(idCanvas)
	{
		jc.start(idCanvas,true);
		jc.rect(100,120,50,30,'#ff0000',true)
			.id('myRect_3');
		jc.line().id('rect_3');
	}
</script>
<canvas id="canvas_3" width="250px" height="265px"></canvas>
View