SlideShare a Scribd company logo
1 of 38
Rockstar Graphics
  with HTML5
       Dave Balmer, Gobico Games
Developer of Wobble Words and Poker Drops
              April 24, 2010
A Clean Slate for Web Developers
Breaking your skills out of the browser
A Clean Slate for Web Developers
Breaking your skills out of the browser


• JavaScript is the focus instead of an addition
• HTML and the DOM provide basic structure;
  layered semantic markup is not a priority
• CSS is the presentation workhorse
• Browser compatibility is not an issue, so
  development
  is faster
• Most frameworks designed for browsers are not
  optimal for mobile devices because they’re firmly
  entrenched in browser-centric approaches (I’m
  looking at you, JQuery)
The Webkit Stack
The Webkit Stack
JavaScript is front and center


                          App Process

                          JavaScript

             Canvas                           CSS3

                             Webkit


                          Linux Kernel

             ARM CPU                     Hardware Graphics
Rockstar Graphics with HTML5
Getting the most out of native code (without coding native)
Rockstar Graphics with HTML5
Getting the most out of native code (without coding native)


• Canvas Element
• CSS3
• Layering techniques
• Efficient JavaScript
• Trickery
Canvas Element
Canvas Element
What it is and when to use it


• An empty box element where JavaScript directly
  draws lines, shapes, images, and other 2D
  primitives
  • Very similar concept to Java2D and Quartz 2D
  • Sophisticated path construction with strokes and fills
  • Image layering and transformation
  • Uses native code under the hood, so render time is fast


• Use it to break outside the DOM “box” model
  • Ad-hoc graphs and charts
  • Synchronized animation with multiple images
Sample Code: Line Graph
A simple Canvas example


• Basic stage

• Simple “Graph” class
  • Array goes in
  • Graph goes out
  • Auto-scales


                          Break away to
                          example before
                          clicking -- reveal
                          screen after code
                          walkthru
Sample Code: Line Graph
A simple Canvas example


• Basic stage

• Simple “Graph” class
  • Array goes in
  • Graph goes out
  • Auto-scales


• Boring!                               Break away to
                                        example before
  • Does illustrate the point           clicking -- reveal
                                        screen after code
  • Definitely not “Rockstar” material   walkthru
  • We’ll add some goodies later
Canvas: Other Uses
Drawing lines is fine, but you can do a lot more


• Image manipulation
  • Transformations (scale, rotate)
  • Compositing (think Photoshop layers)


• Animation
  • Sprites
  • Complex physics
  • The downside: your animation loop will be in JavaScript,
    which can be difficult to get great performance
Canvas Gotchas
Current limitations to keep in mind


• Today’s webOS Canvas element has limitations:
  • No pixel operations (getImageData, putImageData)
  • No shadows (shadowOffsetX/Y, shadowBlur, shadowColor)
  • Cannot save raster contents of canvas (toDataURL)
  • No “round” or “mitre” lineJoin or lineCap (“bevel” only)
Canvas Gotchas
Current limitations to keep in mind


• Today’s webOS Canvas element has limitations:
  • No pixel operations (getImageData, putImageData)
  • No shadows (shadowOffsetX/Y, shadowBlur, shadowColor)
  • Cannot save raster contents of canvas (toDataURL)
  • No “round” or “mitre” lineJoin or lineCap (“bevel” only)


• And Text? Forget it.
  • The W3 spec for Canvas text rendering is exciting,
    but largely unsupported anywhere
  • Layering with DOM/CSS3 is the practical approach
    for now
CSS3
CSS3                                            Mention the
                                                excitingg news
                                                about 3D and
What it is and when to use it                   hardware
                                                accelerated
                                                transitions
• Sophisticated declarative styling language
  • Pixel-perfect font, color, image properties
  • Scale, rotate, stretch, and move any DOM element
  • Animate property changes with simple physics


• Huge benefits for
  • Adding unique and consistent look and feel to your apps
  • Creating your own specialized widgets
  • Simple, unsynchronized animations
Sample Code: Screensaver
A contrived yet fun example of CSS3 animation


• CSS3 animation
• Minimal JavaScript
  • Timer loop
  • Setting properties
  • Letting CSS do the hard stuff




                           Break away to
                           example before
                           clicking -- reveal
                           screen after code
                           walkthru
Sample Code: Screensaver
A contrived yet fun example of CSS3 animation


• CSS3 animation
• Minimal JavaScript
  • Timer loop
  • Setting properties
  • Letting CSS do the hard stuff




                           Break away to
                           example before
                           clicking -- reveal
                           screen after code
                           walkthru
CSS3 Gotchas
Current webOS limitations to keep in mind
CSS3 Gotchas
Current webOS limitations to keep in mind


• No custom fonts
• No textShadow or boxShadow (bummer)
• No gradients
  • Have to use gradient background images today
• No transitionEnd event
  • Limits synchronized animation chaining
  • For now, have to use setTimeout to match transition
    interval
    and “hope for the best”
Layering
Layering
Using CSS3 and Canvas elements together can be powerful


• Both can be controlled with JavaScript
• A good example is a network diagram:
Layering
Using CSS3 and Canvas elements together can be powerful


• Both can be controlled with JavaScript
• A good example is a network diagram:

 CSS Styled Elements +               Canvas 2D Lines

                2                       5
    1                      4                       7
                3                       6
Sample Code: Line Graph +
Our first Canvas example was pretty boring


• Canvas still draws the
  graph

• CSS adds some spice
  • Activate/deactivate
    animation
  • More interesting styling
  • No additional JavaScript
Sample Code: Line Graph +
Our first Canvas example was pretty boring


• Canvas still draws the
  graph

• CSS adds some spice
  • Activate/deactivate
    animation
  • More interesting styling
  • No additional JavaScript
Mix and Match for the Win

Feature                            CSS   Canvas
Text Styling                       ✔
2D Drawing Primitives                      ✔
Sprite Animation                   ✔       ✔
Generated Gradients                        ✔
Image Transformations              ✔       ✔
“Set it and forget it” Animation   ✔
Synchronized Animation                     ✔
Layered transitions                ✔
Layered transformations            ✔
Mix and Match for the Win
Dipping into both Canvas and CSS techniques

 Feature                               CSS    Canvas
 Text Styling                           ✔
 2D Drawing Primitives                          ✔
 Sprite Animation                       ✔       ✔
 Generated Gradients                            ✔
 Image Transformations                  ✔       ✔
 “Set it and forget it” Animation       ✔
 Synchronized Animation                         ✔
 Layered transitions                    ✔
 Layered transformations                ✔
Layering Example: Poker Drops
A quick peek at this game currently in testing


• CSS3 Animations
  • Menu and UI transitions
  • Dealing cards
  • Rotating the game board to
    match device orientation
  • Custom scroller widget
    with basic physics


• Canvas
  • Drawing the path between
    poker cards
  • Game timer
Layering Example: Poker Drops
A quick peek at this game currently in testing


• CSS3 Animations
  • Menu and UI transitions
  • Dealing cards
  • Rotating the game board to
    match device orientation
  • Custom scroller widget
    with basic physics


• Canvas
  • Drawing the path between
    poker cards
  • Game timer
Trickery
JavaScript Performance Efficiencies
Boils down to taking all unnecessary computation out of
loops

• Pre-compute everything

• Make the native code do more work by using
  CSS3, built-in array operations and other goodies
  wherever possible

• Reduce garbage collection impact by re-using
  objects instead of tossing them
Trickery: Examples
Taking a second look at some of the goodness in the
examples

• Graph
  • Simple array-in, graph-out structure
  • Fancy transitions done with CSS3


• Screensaver                              Pull up graph example, walk
                                           thru use of CSS to offload the
  • CSS3 does all the heavy lifting        goodies, and simple array
                                           processing
  • Our timer loop does very little
  • Our “random” animation paths are built from pre-
    computed data
The Future
What We Can Look Forward To
Palm is on board—here’s hoping for speedy implementation


• More complete CSS3 implementation
• More complete Canvas implementation

• Hardware accelerated CSS!

• Canvas 3D
• WebGL
• 3D Transformations in CSS3
Q &A
More Information
Dave Balmer, Gobico Games
@balmer
dave@gobico.com
http://gobico.com

Good CSS and HTML5 Walkthroughs
http://css3.info
http://diveintohtml5.org

“Far Out Fowl” Canvas Game Development Tutorial
http://bit.ly/cdfuQb
Rockstar Graphics with HTML5

More Related Content

What's hot (8)

Drupal Backbone.js in the Frontend
Drupal Backbone.js in the FrontendDrupal Backbone.js in the Frontend
Drupal Backbone.js in the Frontend
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
Before Going Vector
Before Going VectorBefore Going Vector
Before Going Vector
 
SVG - Scalable Vector Graphic
SVG - Scalable Vector GraphicSVG - Scalable Vector Graphic
SVG - Scalable Vector Graphic
 
Deliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sitesDeliverance - a compelling way to theme Plone sites
Deliverance - a compelling way to theme Plone sites
 
Svg
SvgSvg
Svg
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 

Similar to Rockstar Graphics with HTML5

Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
johnnybiz
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
Blazing Cloud
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphia
canarymason
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
canarymason
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
Andrea Verlicchi
 

Similar to Rockstar Graphics with HTML5 (20)

Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Psd 2 Drupal
Psd 2 DrupalPsd 2 Drupal
Psd 2 Drupal
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)Talk Paris Infovis 091207132953 Phpapp01(2)
Talk Paris Infovis 091207132953 Phpapp01(2)
 
Using Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the WebUsing Web Standards to create Interactive Data Visualizations for the Web
Using Web Standards to create Interactive Data Visualizations for the Web
 
Iagc2
Iagc2Iagc2
Iagc2
 
Interactive Graphics
Interactive GraphicsInteractive Graphics
Interactive Graphics
 
Sugarcoating your frontend one ViewModel at a time
Sugarcoating your frontend one ViewModel at a timeSugarcoating your frontend one ViewModel at a time
Sugarcoating your frontend one ViewModel at a time
 
Designing in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, DrupaldelphiaDesigning in the Browser - Mason Wendell, Drupaldelphia
Designing in the Browser - Mason Wendell, Drupaldelphia
 
Html5 Whats around the bend
Html5 Whats around the bendHtml5 Whats around the bend
Html5 Whats around the bend
 
The Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital CampThe Coding Designer's Survival Kit - Capital Camp
The Coding Designer's Survival Kit - Capital Camp
 
Html5 Canvas and Mobile Graphics
Html5 Canvas and Mobile GraphicsHtml5 Canvas and Mobile Graphics
Html5 Canvas and Mobile Graphics
 
Css3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQueryCss3 transitions and animations + graceful degradation with jQuery
Css3 transitions and animations + graceful degradation with jQuery
 
Modern Web Development
Modern Web DevelopmentModern Web Development
Modern Web Development
 
Responsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and TechniquesResponsive Web Design: Clever Tips and Techniques
Responsive Web Design: Clever Tips and Techniques
 
Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3Vector Graphics on the Web: SVG, Canvas, CSS3
Vector Graphics on the Web: SVG, Canvas, CSS3
 
10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)10 Advanced CSS Techniques (You Wish You Knew More About)
10 Advanced CSS Techniques (You Wish You Knew More About)
 
The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)The web standards gentleman: a matter of (evolving) standards)
The web standards gentleman: a matter of (evolving) standards)
 
Css3
Css3Css3
Css3
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Rockstar Graphics with HTML5

  • 1.
  • 2. Rockstar Graphics with HTML5 Dave Balmer, Gobico Games Developer of Wobble Words and Poker Drops April 24, 2010
  • 3. A Clean Slate for Web Developers Breaking your skills out of the browser
  • 4. A Clean Slate for Web Developers Breaking your skills out of the browser • JavaScript is the focus instead of an addition • HTML and the DOM provide basic structure; layered semantic markup is not a priority • CSS is the presentation workhorse • Browser compatibility is not an issue, so development is faster • Most frameworks designed for browsers are not optimal for mobile devices because they’re firmly entrenched in browser-centric approaches (I’m looking at you, JQuery)
  • 6. The Webkit Stack JavaScript is front and center App Process JavaScript Canvas CSS3 Webkit Linux Kernel ARM CPU Hardware Graphics
  • 7. Rockstar Graphics with HTML5 Getting the most out of native code (without coding native)
  • 8. Rockstar Graphics with HTML5 Getting the most out of native code (without coding native) • Canvas Element • CSS3 • Layering techniques • Efficient JavaScript • Trickery
  • 10. Canvas Element What it is and when to use it • An empty box element where JavaScript directly draws lines, shapes, images, and other 2D primitives • Very similar concept to Java2D and Quartz 2D • Sophisticated path construction with strokes and fills • Image layering and transformation • Uses native code under the hood, so render time is fast • Use it to break outside the DOM “box” model • Ad-hoc graphs and charts • Synchronized animation with multiple images
  • 11. Sample Code: Line Graph A simple Canvas example • Basic stage • Simple “Graph” class • Array goes in • Graph goes out • Auto-scales Break away to example before clicking -- reveal screen after code walkthru
  • 12. Sample Code: Line Graph A simple Canvas example • Basic stage • Simple “Graph” class • Array goes in • Graph goes out • Auto-scales • Boring! Break away to example before • Does illustrate the point clicking -- reveal screen after code • Definitely not “Rockstar” material walkthru • We’ll add some goodies later
  • 13. Canvas: Other Uses Drawing lines is fine, but you can do a lot more • Image manipulation • Transformations (scale, rotate) • Compositing (think Photoshop layers) • Animation • Sprites • Complex physics • The downside: your animation loop will be in JavaScript, which can be difficult to get great performance
  • 14. Canvas Gotchas Current limitations to keep in mind • Today’s webOS Canvas element has limitations: • No pixel operations (getImageData, putImageData) • No shadows (shadowOffsetX/Y, shadowBlur, shadowColor) • Cannot save raster contents of canvas (toDataURL) • No “round” or “mitre” lineJoin or lineCap (“bevel” only)
  • 15. Canvas Gotchas Current limitations to keep in mind • Today’s webOS Canvas element has limitations: • No pixel operations (getImageData, putImageData) • No shadows (shadowOffsetX/Y, shadowBlur, shadowColor) • Cannot save raster contents of canvas (toDataURL) • No “round” or “mitre” lineJoin or lineCap (“bevel” only) • And Text? Forget it. • The W3 spec for Canvas text rendering is exciting, but largely unsupported anywhere • Layering with DOM/CSS3 is the practical approach for now
  • 16. CSS3
  • 17. CSS3 Mention the excitingg news about 3D and What it is and when to use it hardware accelerated transitions • Sophisticated declarative styling language • Pixel-perfect font, color, image properties • Scale, rotate, stretch, and move any DOM element • Animate property changes with simple physics • Huge benefits for • Adding unique and consistent look and feel to your apps • Creating your own specialized widgets • Simple, unsynchronized animations
  • 18. Sample Code: Screensaver A contrived yet fun example of CSS3 animation • CSS3 animation • Minimal JavaScript • Timer loop • Setting properties • Letting CSS do the hard stuff Break away to example before clicking -- reveal screen after code walkthru
  • 19. Sample Code: Screensaver A contrived yet fun example of CSS3 animation • CSS3 animation • Minimal JavaScript • Timer loop • Setting properties • Letting CSS do the hard stuff Break away to example before clicking -- reveal screen after code walkthru
  • 20. CSS3 Gotchas Current webOS limitations to keep in mind
  • 21. CSS3 Gotchas Current webOS limitations to keep in mind • No custom fonts • No textShadow or boxShadow (bummer) • No gradients • Have to use gradient background images today • No transitionEnd event • Limits synchronized animation chaining • For now, have to use setTimeout to match transition interval and “hope for the best”
  • 23. Layering Using CSS3 and Canvas elements together can be powerful • Both can be controlled with JavaScript • A good example is a network diagram:
  • 24. Layering Using CSS3 and Canvas elements together can be powerful • Both can be controlled with JavaScript • A good example is a network diagram: CSS Styled Elements + Canvas 2D Lines 2 5 1 4 7 3 6
  • 25. Sample Code: Line Graph + Our first Canvas example was pretty boring • Canvas still draws the graph • CSS adds some spice • Activate/deactivate animation • More interesting styling • No additional JavaScript
  • 26. Sample Code: Line Graph + Our first Canvas example was pretty boring • Canvas still draws the graph • CSS adds some spice • Activate/deactivate animation • More interesting styling • No additional JavaScript
  • 27. Mix and Match for the Win Feature CSS Canvas Text Styling ✔ 2D Drawing Primitives ✔ Sprite Animation ✔ ✔ Generated Gradients ✔ Image Transformations ✔ ✔ “Set it and forget it” Animation ✔ Synchronized Animation ✔ Layered transitions ✔ Layered transformations ✔
  • 28. Mix and Match for the Win Dipping into both Canvas and CSS techniques Feature CSS Canvas Text Styling ✔ 2D Drawing Primitives ✔ Sprite Animation ✔ ✔ Generated Gradients ✔ Image Transformations ✔ ✔ “Set it and forget it” Animation ✔ Synchronized Animation ✔ Layered transitions ✔ Layered transformations ✔
  • 29. Layering Example: Poker Drops A quick peek at this game currently in testing • CSS3 Animations • Menu and UI transitions • Dealing cards • Rotating the game board to match device orientation • Custom scroller widget with basic physics • Canvas • Drawing the path between poker cards • Game timer
  • 30. Layering Example: Poker Drops A quick peek at this game currently in testing • CSS3 Animations • Menu and UI transitions • Dealing cards • Rotating the game board to match device orientation • Custom scroller widget with basic physics • Canvas • Drawing the path between poker cards • Game timer
  • 32. JavaScript Performance Efficiencies Boils down to taking all unnecessary computation out of loops • Pre-compute everything • Make the native code do more work by using CSS3, built-in array operations and other goodies wherever possible • Reduce garbage collection impact by re-using objects instead of tossing them
  • 33. Trickery: Examples Taking a second look at some of the goodness in the examples • Graph • Simple array-in, graph-out structure • Fancy transitions done with CSS3 • Screensaver Pull up graph example, walk thru use of CSS to offload the • CSS3 does all the heavy lifting goodies, and simple array processing • Our timer loop does very little • Our “random” animation paths are built from pre- computed data
  • 35. What We Can Look Forward To Palm is on board—here’s hoping for speedy implementation • More complete CSS3 implementation • More complete Canvas implementation • Hardware accelerated CSS! • Canvas 3D • WebGL • 3D Transformations in CSS3
  • 36. Q &A
  • 37. More Information Dave Balmer, Gobico Games @balmer dave@gobico.com http://gobico.com Good CSS and HTML5 Walkthroughs http://css3.info http://diveintohtml5.org “Far Out Fowl” Canvas Game Development Tutorial http://bit.ly/cdfuQb

Editor's Notes