Presentation is loading. Please wait.

Presentation is loading. Please wait.

HTML5 – The Power of HTML5 – The Power of Thomas Lewis HTML5 Principal Technical Evangelist Microsoft | asimplepixel.tumblr.com.

Similar presentations


Presentation on theme: "HTML5 – The Power of HTML5 – The Power of Thomas Lewis HTML5 Principal Technical Evangelist Microsoft | asimplepixel.tumblr.com."— Presentation transcript:

1

2 HTML5 – The Power of HTML5 – The Power of Thomas Lewis HTML5 Principal Technical Evangelist Microsoft Corporation @tommylee | asimplepixel.tumblr.com

3

4 Demos

5 Apple’s Dashboard Widget Platform Supported in all modern browsers Shimmed for browsers that do not support Canvas (caveats apply) HTML5 element that allows for dynamic, scriptable rendering of 2D shapes and bitmaps

6 Immediate Mode – Faster – Less Memory Intensive – More Work for Developers Without JavaScript, you are toast Good for casual games, charting, data visualization, & consumer micro-sites

7 Fundamentals

8 The API (~45 methods and 21 attributes) State Transformations Compositing Colors and styles Line caps/joins Shadows Rects Path API Focus management Drawing images Text Pixel Manipulation Interfaces – CanvasGradient – TextMetrics – ImageData – CanvasPixelArray

9 Hello World of Canvas

10

11 Primitives…yeah, but how do I build something like a game?

12 Would you like to play a game?

13

14 Sample Walkthrough (Sparklines)

15

16 What about SVG?

17 SVG SVG describes “Scalable Vector Graphics”. Retained mode rendering. Like HTML, SVG is built into the document using elements, attributes and styles.

18

19

20

21

22 Tools

23

24

25

26 Tips and Misc.

27

28

29

30 ctx.shadowOffsetX = 10; ctx.shadowOffsetY = 10; ctx.shadowBlur = 10; ctx.shadowColor = "rgba(0, 0, 0, 1)"; ctx.fillText(“Winning!”, 10, 25); // All future operations will also have a shadow ctx.strokeRect(0, 0, 115, 40);

31 ctx.save(); ctx.shadowOffsetX = 10; ctx.shadowOffsetY = 10; ctx.shadowBlur = 10; ctx.shadowColor = "rgba(0, 0, 0, 1)"; ctx.fillText(“Winning!”, 10, 25); ctx.restore(); // All future operations will NOT have a shadow ctx.strokeRect(0, 0, 115, 40);

32 Accessibility - Fallback Content Focus Access to the DOM tree within tag Elements within the tag are considered Fallback content and are only displayed on screen when Canvas is not supported. This same Fallback area can be used for Accessibility description of what is on the Canvas

33 DO: Canvas feature detection code DON’T: Browser detection using User Agent string DON’T: Conditional comments

34 DO: Add a DOCTYPE Add W3C HTML5 DOCTYPE: Or add common strict DOCTYPE:

35

36

37 DO: Use a 17ms interval for setTimeOut() and SetInterval(). They take integer values – round up 16.7ms. DON’T: Use a 1ms interval for timers Using a smaller interval than 17ms has no benefit: it results in choppy animation and reduced battery life

38 Disney:Tron Case Study Built in one month (Vectorform) Hardware acceleration 5 days of image prep Considered CSS, pure JavaScript, others Struggled with video sync capabilities of different browsers

39 Resources

40

41

42

43

44 Thank You! @tommylee asimplepixel.tumblr.com


Download ppt "HTML5 – The Power of HTML5 – The Power of Thomas Lewis HTML5 Principal Technical Evangelist Microsoft | asimplepixel.tumblr.com."

Similar presentations


Ads by Google