Objects / rect
rect(x, y, width, height, [color], [fill])
rect(float x, float y, float width, float height)
rect(float x, float y, float width, float height, bool fill)
rect(float x, float y, float width, float height, string color)
rect(float x, float y, float width, float height, string color, bool fill)
rect(object parameters)

Create a jCanvaScript object,which draws a rectangle on canvas.
rect(float x, float y, float width, float height)
Code
<script type="text/javascript">
	function onload_1(idCanvas)
	{
		jc.start(idCanvas);
		jc.rect(80,100,120,50);
		jc.rect(50,20,100,100);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View
rect(float x, float y, float width, float height, bool fill)
Code
<script type="text/javascript">
	function onload_2(idCanvas)
	{
		jc.start(idCanvas);
		jc.rect(150,120,50,100,true);
		jc.rect(50,20,50,100,false);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View
rect(float x, float y, float width, float height, string color)
Code
<script type="text/javascript">
	function onload_3(idCanvas)
	{
		jc.start(idCanvas);
		jc.rect(150,120,50,100,'rgba(255,156,135,0.5)');
		jc.rect(50,20,50,100,'#0054f2');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_3" width="250px" height="265px">
</canvas>
View
rect(float x, float y, float width, float height, string color, bool fill)
Code
<script type="text/javascript">
	function onload_4(idCanvas)
	{
		jc.start(idCanvas);
		jc.rect(80,100,120,50,'rgba(255,156,135,0.5)',1);
		jc.rect(50,20,100,100,'#0054f2',0);
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_4" width="250px" height="265px">
</canvas>
View
rect(object parameters)
Code
<script type="text/javascript">
	function onload_5(idCanvas)
	{
		jc.start(idCanvas);
		jc.rect({x:80,y:100,width:120,height:50,color:'rgba(255,156,135,0.5)',fill:1});
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_5" width="250px" height="265px">
</canvas>
View