18.11.2017 Views

html5_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

HTML5<br />

}<br />

}<br />

<br />

<br />

<br />

<br />

<br />

<br />

The above example would produce the following result –<br />

HTML5 Canvas - Translation<br />

HTML5 canvas provides translate(x, y) method which is used to move the canvas and its<br />

origin to a different point in the grid.<br />

Here argument x is the amount the canvas is moved to the left or right, and y is the<br />

amount it's moved up or down<br />

Example<br />

Following is a simple example which makes use of above method to draw various<br />

Spirographs −<br />

<br />

<br />

<br />

<br />

#test {<br />

width:100px;<br />

100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!