HTML5 Canvas

Download Report

Transcript HTML5 Canvas

HTML5 Canvas Essentials Steve Fulton & Jeff Fulton

Something Cool The Canvas Can Do Demo

Easily takes a hidden video from the HTML page, displays it multiple times, moves each copy Independently it around the screen, while playing it.

Who Are We?

• • • • • • • Steve and Jeff Fulton (twins) Web developers since 1995 Worked for Mattel Toys until 2010/2011 on all of their web properties (Barbie, Hot Wheels, etc.) including games apps. MMOs Have Built over 200 games in Flash, HTML5, Mobile Authored of The Essential Guide To Flash Games book in 2010 Authored of HTML 5 Canvas in 2011 Now both working in independently on mobile, web, multi-player HTML5, Flash, Corona games and apps

• • •

Why Move From Flash to The Canvas? Our Story

Finished Essential guide To Flash Games in March 2010 Steve Jobs refused Flash on the iOS just days later Wanted to find a technology that would be truly multi-platform and not be subject to whims of CEOs

• • •

Why Move From Flash to The Canvas? Our Story

Easy Tools: a web browser, text editor and JavaScript was all that was required.

The HTML5 Canvas allowed for a bitmapped graphics, much Flash’s bitmapped canvas.

Our specific Type Of Game Development translates well (tile sheets, bitmaps)

What is the HTML5 Canvas?

• The HTML5 Canvas is an Immediate Mode bit mapped area of the screen that can be manipulated with JavaScript and CSS.

What Is Immediate Mode?

• Immediate Mode refers to the way the canvas renders pixels on the screen. The HTML5 Canvas completely redraws the bitmapped screen on every frame using Canvas API calls from JavaScript. As a programmer, your job is to set-up the screen display before each frame is rendered.

What Is Retained Mode?

• Flash, Silverlight, and DOM

manipulation techniques use Retained Mode. In Retained Mode a list of individual display objects is stored and manipulated.

HTML5 Canvas Support

• Support for the Canvas is growing. Right now we think the best browser support goes in this order: – Chrome – Safari (Mac and iOS 5) – I.E. 9 (surprised?) – Firefox – Opera

HTML5 Canvas Support : Mobile

• • • • Support and performance has increased in 2011 iOS 5 improved performance greatly Current Android performance is poor to good depending on the device Windows 8/Metro is supposedly built to handle HTML5 Canvas, and we believe that is the reason I.E. 9 ranks so highly right now

Canvas And The DOM

• • • • DOM : Document Object Model Canvas is a DOM Object Accessible via the 2D Canvas context Has both it’s own properties and CSS properties

What Can The Canvas Be Used for?

• Nearly anything that Flash notorious for: – Banner Ads – Animated Landing Pages – Web Games – Video

Canvas Banner Ad

• • •

Demo

Should be put in an