from flash to canvas - a penchant for black holes

23
a penchant for black holes From Flash to Canvas @flashpatric

Upload: patric-lanhed

Post on 06-Dec-2014

1.638 views

Category:

Technology


1 download

DESCRIPTION

This session will cover what HTML5 developers can benefit from knowing its way around in the world of Flash and ActionScript. The tools that could be used for a better Canvas experience and foremost how the display list will ease your burden.

TRANSCRIPT

Page 1: From Flash to Canvas - a penchant for black holes

a penchant for black holesFrom Flash to Canvas

@flashpatric

Page 2: From Flash to Canvas - a penchant for black holes

THIS PRESENTATIONCanvas 2D context

HistoryToday

How a display list will make your life easierTools for a better Canvas experience

Demo

Page 3: From Flash to Canvas - a penchant for black holes

WHAT’S CANVAS?!

A part of the HTML5 standard

Dynamic bitmap

API’s for drawing and using text

<canvas id=”canvas”></canvas>

Page 4: From Flash to Canvas - a penchant for black holes

ADVANTAGESFrom a Flash developers point of view

Low learning curve

Very good performance in new browsers

Image manipulation down to pixel level

Lots of proven JS-libraries

Pretty high market penetration

3D context – WebGL

GPU acceleration

Powerful along with other new functionsSemanticsOffline & StorageDevice accessConnectivityAudio & video3D graphics & effectsPerformance & IntegrationCSS3

Page 5: From Flash to Canvas - a penchant for black holes

HISTORYFlash vs HTML

1995FutureSplash HTML 3.2 draft, Internet Explorer1996Macromedia I Learned HTML19982000My first Flash applikation, Actionscript 1

HTML 4.01 draft

2003Actionscript 2 Firefox2004 WHATWG

Adobe 2005Actionscript 3 2006

2007 HTMLWG, death of XHTMLAdobe AIR 2008 Google Chrome

Mobile Flash Player, Scepticism 2009 HTML5Adobe AIR for Android & iOS 2010 IE9

Adobe AIR for iOS, Mobile Flash Player 2011 Shifting focus, comunication fail

Page 6: From Flash to Canvas - a penchant for black holes

TODAY

Canvas basic support

71.17%

Opera Mini has partial support for Canvas

HTML5 Canvas 2D market penetration

Text API for Canvas

70.56%

Opera Mini is missing support for Text API

CSS Canvas Drawing

35.56% (Chrome, Safari, iOS Safari, Android

browser)

Full Screen API

0%

Partial support in Firefox, Chrome och Safari

Page 7: From Flash to Canvas - a penchant for black holes

TODAY

IE8 and below is missing support for Canvas

Polyfills can be used for VML in IE7 and IE8

Explorercanvas.js

Everything is not supported, there’s limitations!

- Only linear gradients- Patterns must repeat in both directions- Clipping paths is not supported- Non-uniform scaling does not scale outlines correctly- Really bad performance

Canvas 2D Context in Internet Explorer

<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title>Dive Into HTML5 Canvas</title> <!--[if lt IE 9]> <script src="excanvas.js"></script> <![endif]--></head><body> ... </body></html>

Page 8: From Flash to Canvas - a penchant for black holes

DISADVANTAGESFrom a Flash developers point of view

Polyfills is needed for older browsers

No timeline or API for animations

Bad text rendering

There is no editor for Canvas yet

Drawn objects is only pixels

No display list/scene graph

Page 9: From Flash to Canvas - a penchant for black holes

Adobe Flash Professional CS6

THE OPTIMISTBut there’s hope for Canvas

Polyfills cover some needs

We’re programmers!

Web fonts

Dynamic pixels

Logic display list

Page 10: From Flash to Canvas - a penchant for black holes

WHAT A DISPLAY LIST IS”A hierarchic list with graphical objects

described with its properties”

Page 11: From Flash to Canvas - a penchant for black holes

WHAT A DISPLAY LIST ISDisplay ObjectFamily based – parents and children

Inherits from an abstract class

Renders in relation to its parent

Its properties determines the rendering

Different objects and propertiesStage

Bitmap

Shape

Text

x & y

alpha

scaleX & scaleY

Etc..

Page 12: From Flash to Canvas - a penchant for black holes

THE TOOLS

Page 13: From Flash to Canvas - a penchant for black holes

CREATEJSA suite of Javascript libraries & tools for building

rich, interactive experiences with HTML5

Page 14: From Flash to Canvas - a penchant for black holes

EASELJSBased on the Flash display list

Display list and display list objects

DOM-elements

Mouse events on objects, even onClick and onPress

Touch support

Page 15: From Flash to Canvas - a penchant for black holes

TWEENJSA Javascript library for tweening and animating HTML5

and Javascript properties

Page 16: From Flash to Canvas - a penchant for black holes

SOUNDJSA Javascript library that provides a simple API, and

powerful features to make working with audio a breeze

Page 17: From Flash to Canvas - a penchant for black holes

PRELOADJSA Javascript library that lets you manage and co-ordinate

the loading of assets

Page 18: From Flash to Canvas - a penchant for black holes

ZOËA stand alone tool for exporting SWF animations as

EaselJS sprite sheets that can be used in Canvas and CSS

Page 19: From Flash to Canvas - a penchant for black holes

DEMO!

Page 20: From Flash to Canvas - a penchant for black holes

Adobe Flash Professional CS6Toolkit for CreateJS

Nested animationsSoundsDynamic textsVector objectsArmatureShape morphs

Page 21: From Flash to Canvas - a penchant for black holes

DEMO!

Page 22: From Flash to Canvas - a penchant for black holes

Grant Skinnergskinner.com

Recognized speaker, leader and innovator within interactive media

GtweenRegExr

CreateJSEaselGL

Founder of CREATEJS

Page 23: From Flash to Canvas - a penchant for black holes

THANKS!Patric Jonsson

Interactive Developer

@[email protected]