Bringing Out Your Inner Artist: The Canvas

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

xvitable of contentsOur new startup: TweetShirt 282Checking out the “comps” 283How to

get a canvas into your web page 286How to see your canvas 288Drawing on the Canvas
290Failing gracefully 295TweetShirt: the Big Picture 297First, let’s get the HTML in place
300Now, let’s add the <form> 301Time to get computational, with JavaScript 302Writing the
drawSquare function 304Add the call to fillBackgroundColor 307Meanwhile, back at
TweetShirt.com... 309Drawing with Geeks 311Breaking down the arc method 314A little
taste of using the arc 316I say degree, you say radian 317Back to writing the TweetShirt
circle code 318Writing the drawCircle function... 319Getting your tweets 323Canvas Text Up
Close 328Giving drawText a spin 330Completing the drawText function 331Bullet Points

338Exercise Solutions 341 7 The Canvasbringing

inner artistHTML’s been liberated from being just a


out your

“markup” language. With HTML5’s new canvas element you’ve got the power
to create, manipulate and destroy pixels, right in your own hands. In this chapter we'll
use the canvas element to bring out your inner artist—no more talk about HTML
being all semantics and no presentation; with canvas we're going to paint and draw
with color. Now it's all about presentation. We’ll tackle how to place a canvas in your
pages, how to draw text and graphics (using JavaScript of course), and even how to
handle browsers that don't support the canvas element. And canvas isn't just a one-
hit wonder; you're going to be seeing a lot more of canvas in other chapters in this
book.A new HTML5 startup is just waitin

You might also like