Kids Learning Javascript: Kids learn coding like playing games by Yang Hu
Author:Yang Hu [Hu, Yang]
Language: eng
Format: azw3
Published: 2020-04-13T16:00:00+00:00
<script type ="text/javascript" >
var canvas = document.getElementById( "myCanvas" );
//Begin a path create a line move from (20,100) to (200,100):
var context = canvas.getContext( "2d" );
context.beginPath();
context.moveTo( 20 , 100 );
context.lineTo( 200 , 100 );
context.stroke();
</script>
3. Draw a Rectangle on Canvas
context.fillRect(x, y, width, height): draw a rectangle on the canvas.
context.fillStyle: the color to fill rectangle(red : #ff0000, green: #00ff00, blue: #0000ff).
<style>
#myCanvas{
border:1px solid #c3c3c3;
}
</style>
<canvas id ="myCanvas" width ="400" height ="200" ></canvas>
<script type ="text/javascript" >
var canvas = document.getElementById( "myCanvas" );
//Begin a path create a rectangle
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
American History Stories, Volume III (Yesterday's Classics) by Pratt Mara L(5116)
Paper Towns by Green John(4747)
The Giant and How He Humbugged America by Jim Murphy(3261)
The Science Book (Big Ideas Simply Explained) by DK(3112)
The President Has Been Shot!": The Assassination of John F. Kennedy by Swanson James L(2949)
Eleanor & Park by Rainbow Rowell(2911)
The Rape Of Nanking by Iris Chang(2615)
Merriam-Webster's Collegiate Thesaurus, Second Edition by Merriam-Webster Inc(2580)
Harry Potter and the Deathly Hallows (7) by J.K. Rowling(2505)
Eligible by Curtis Sittenfeld(2466)
Ancient Worlds by Michael Scott(2463)
Beautiful Oblivion by Jamie McGuire(2441)
Dork Diaries 12 by Rachel Renée Russell(2246)
The Unlikely Pilgrimage of Harold Fry by Rachel Joyce(2116)
Sharp Objects by Gillian Flynn(2103)
Frankly, Frannie by AJ Stern(2065)
The Astronomy Book by DK(2033)
Forensics by Val McDermid(1949)
Who Was Louis Braille? by Margaret Frith(1868)
