Functions / text align
align(align)
align( )
align(string align)

Allows to set or to check align of jCanvaScript text. By default it's 'start'.

Possible values: 'left' - The text is left-aligned, 'right' - The text is right-aligned, 'center' - The text is centered, 'start' - The text is aligned at the normal start of the line (left-aligned for left-to-right locales, right-aligned for right-to-left locales), 'end' - The text is aligned at the normal end of the line (right-aligned for left-to-right locales, left-aligned for right-to-left locales)

align( )
return: string align
Code
<script type="text/javascript">
	function start_1(idCanvas)
	{
		alert(jc('#myText_1').align());
	}
	function stop_1(idCanvas)
	{
		jc('#myText_1')
			.align('center');
		jc.start(idCanvas);
	}
	function onload_1(idCanvas)
	{
		jc.start(idCanvas);
		jc.text("Text example",90,130)
			.id('myText_1');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_1" width="250px" height="265px"></canvas>
View
align(string align)
return: object
Code
<script type="text/javascript">
	function start_2(idCanvas)
	{
		jc('#myText_2')
			.align('right');
		jc.start(idCanvas);
	}
	function stop_2(idCanvas)
	{
		jc('#myText_2')
			.align('center');
		jc.start(idCanvas);
	}
	function onload_2(idCanvas)
	{
		jc.start(idCanvas);
		jc.text("Text example",90,130)
			.id('myText_2');
		jc.start(idCanvas);
	}
</script>
<canvas id="canvas_2" width="250px" height="265px"></canvas>
View