HTML5 canvas element has the ability to use the images. Firstly to load or draw the image on the canvas element we need to create the HTMLImageElement object and then use the drawImage() function. drawImage() function can accept several parameters.
The Following example demonstrates how to marque text right to left on the canvas in HTML5. The example uses the save(), translate() and restore() methods to animate the text.
The following code example shows the text fade in and fade out effect on the canvas in HTMl5.
You can create text marquee (i.e. scrolling text left to right and right to left on the canvas) and can create a text animation such as text rotation, text highlight etc. The article demonstrate the following text animations on the canvas. See the Demo. All example, displays the text “Welcome” in the various … Continue reading Text Animation in HTML5
The following code example demonstrates how to rotate and scale text on the canvas in HTML5.
The Following example demonstrates how to scroll the text left to right on the canvas in HTML5. The example does not use any CSS for marquee text. Try the example:
The Following example gives you an idea to scrolling the text on the canvas in HTML 5. The example uses the save(), translate() and restore() methods to animate the text.
Text Alignment We can set the text alignment of the text by setting the context’s textAlign property. The valid values will be left, right, and center.