Slide 1

Slide 1 text

CreateJS 從 Flash 到 JavaScript

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

I’m a Ruby guy ≈ 4 years

Slide 4

Slide 4 text

but also a Flash guy ≈ 8 years

Slide 5

Slide 5 text

目前狀狀態 80% iOS app, 20% Ruby / Rails

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

CreateJS 從 Flash 到 JavaScript

Slide 9

Slide 9 text

在開始之前..

Slide 10

Slide 10 text

武林林㆗㊥中, 曾流流傳著許多的 Flash 殺殺手..

Slide 11

Slide 11 text

Flash 真的死了了嗎?

Slide 12

Slide 12 text

可能吧 :)

Slide 13

Slide 13 text

Flash Play != Flash

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

如果你曾經是個 Flash 程式設計師 或是現在還靠 Flash 討生活...

Slide 16

Slide 16 text

該㈻㊫學 HTML5 嗎?

Slide 17

Slide 17 text

聽說說說 HTML5 的 Canvas ㈲㊒有點難?!

Slide 18

Slide 18 text

Grant Skinner photo by Andy Polaine http://gskinner.com/

Slide 19

Slide 19 text

http://www.createjs.com

Slide 20

Slide 20 text

EaselJS .. provides a full, hierarchical display list, a core interaction model, and helper classes to make working with the HTML5 Canvas element much easier.

Slide 21

Slide 21 text

TweenJS A simple but powerful tweening / animation library for Javascript. Part of the CreateJS suite of libraries.

Slide 22

Slide 22 text

SoundJS A Javascript library for working with Audio. Features a simple interface as the front end to multiple audio APIs via a plugin model. Currently supports HTML5 Audio & Flash.

Slide 23

Slide 23 text

PreloadJS .. makes preloading assets & getting aggregate progress events easier in JavaScript. It uses XHR2 when available, and falls back to tag-based loading when not.

Slide 24

Slide 24 text

原因?

Slide 25

Slide 25 text

CreateJS 是 真.大神神㊢寫的!

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

Flash-like 的 API

Slide 29

Slide 29 text

㈲㊒有文件、範例例!

Slide 30

Slide 30 text

授權?

Slide 31

Slide 31 text

MIT

Slide 32

Slide 32 text

Flash == Commercial software

Slide 33

Slide 33 text

Flash != Not Open

Slide 34

Slide 34 text

安裝

Slide 35

Slide 35 text

✴ 就放在你的專案裡裡.. ✴ 或是直接從 CDN 引入.. 安裝

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

哈囉,世界!

Slide 38

Slide 38 text

哈囉,世界 var canvas = document.getElementById("demo_canvas"); var stage = new createjs.Stage(canvas); var text = new createjs.Text("Hello, World"); text.color = "white"; text.font = "25px Ariel"; text.x = 50; text.y = 50; stage.addChild(text); stage.update();

Slide 39

Slide 39 text

等等! 剛剛的程式碼裡裡面是不不是㈲㊒有看到 "Stage" 跟 "addChild"..?!

Slide 40

Slide 40 text

應該是巧合吧 反正程式都都嘛長得很像.. :)

Slide 41

Slide 41 text

小圈圈

Slide 42

Slide 42 text

畫圈圈 var canvas = document.getElementById("demo_canvas"); var stage = new createjs.Stage(canvas); var graphic = new createjs.Graphics(); graphic.beginStroke("white"); graphic.setStrokeStyle(5); graphic.beginFill("red"); graphic.drawCircle(100, 100, 50); var shape = new createjs.Shape(graphic); stage.addChild(shape); stage.update();

Slide 43

Slide 43 text

var canvas = document.getElementById("demo_canvas"); var stage = new createjs.Stage(canvas); var graphic = new createjs.Graphics(); graphic.beginStroke("white") .setStrokeStyle(5) .beginFill("red") .drawCircle(100, 100, 50); var shape = new createjs.Shape(graphic); stage.addChild(shape); stage.update(); 畫圈圈

Slide 44

Slide 44 text

var canvas = document.getElementById("demo_canvas"); var stage = new createjs.Stage(canvas); var graphic = new createjs.Graphics(); graphic.s("white") .ss(5) .f("red") .dc(100, 100, 50); var shape = new createjs.Shape(graphic); stage.addChild(shape); stage.update(); 畫圈圈

Slide 45

Slide 45 text

親愛的, 剛剛是不不是㈲㊒有看到 "Graphics" 跟 "Shape",還㈲㊒有㆒㈠㊀一些熟悉的畫線、 畫圈圈跟著色的方法..?!

Slide 46

Slide 46 text

旋轉吧,方塊!

Slide 47

Slide 47 text

旋轉吧,方塊! var stage, shape; function init() { var canvas = document.getElementById("demo_canvas"); stage = new createjs.Stage(canvas); var g = new createjs.Graphics(); g.s("white").ss(5).f("red").dr(0, 0, 100, 100); shape = new createjs.Shape(g); shape.x = shape.y = 150; shape.regX = shape.regY = 50; stage.addChild(shape); stage.update(); createjs.Ticker.setFPS(30); createjs.Ticker.addEventListener("tick", tickHandler); } function tickHandler (event) { shape.rotation += 4; stage.update(); }

Slide 48

Slide 48 text

Classes in EaselJS

Slide 49

Slide 49 text

DisplayObject Abstract base class for all display elements in EaselJS. Exposes all of the display properties (ex. x, y, rotation, scaleX, scaleY, skewX, skewY, alpha, shadow, etc) that are common to all display objects.

Slide 50

Slide 50 text

Stage The root level display container for display elements. Each time tick() is called on Stage, it will update and render the display list to its associated canvas.

Slide 51

Slide 51 text

親愛的 Flasher 們, ㈲㊒有種回家、熟悉的感動了了嗎..

Slide 52

Slide 52 text

Container A nestable display container, which lets you aggregate display objects and manipulate them as a group.

Slide 53

Slide 53 text

㆒㈠㊀一層包㆒㈠㊀一層

Slide 54

Slide 54 text

Text Renders a single line of text to the stage.

Slide 55

Slide 55 text

Bitmap Draws an image, video or canvas to the canvas according to its display properties.

Slide 56

Slide 56 text

Shape Renders a Graphics object within the context of the display list.

Slide 57

Slide 57 text

Graphics Provides an easy to use API for drawing vector data. Can be used with Shape, or completely stand alone.

Slide 58

Slide 58 text

Filter The base filter class that other filters (ex. BoxBlurFilter, ColorMatrixFilter, etc) extend.

Slide 59

Slide 59 text

Ticker Provides a pausable centralized tick manager for ticking Stage instances or other time based code.

Slide 60

Slide 60 text

Rectangle Represents a rectangle as defined by the points (x, y) and (x +width, y+height).

Slide 61

Slide 61 text

SpriteSheet Encapsulates all the data associated with a sprite sheet to be used with BitmapAnimation.

Slide 62

Slide 62 text

動畫!

Slide 63

Slide 63 text

No content

Slide 64

Slide 64 text

But!

Slide 65

Slide 65 text

好啦, 我知道你們㊢寫程式的都都很厲害..

Slide 66

Slide 66 text

我是美術設計師, 只會畫圖以及用 Flash 拉拉時間軸 做動畫,㊢寫些簡單的 gotoAndPlay( )

Slide 67

Slide 67 text

工具包?!

Slide 68

Slide 68 text

Zoë A stand alone tool for exporting SWF animations as EaselJS sprite sheets that can be used in Canvas and CSS.

Slide 69

Slide 69 text

CreateJS toolkits

Slide 70

Slide 70 text

改得動嗎?!

Slide 71

Slide 71 text

匯出檔案大小?!

Slide 72

Slide 72 text

效能?!

Slide 73

Slide 73 text

我沒㈲㊒有評估過所㈲㊒有的 javascript libs..

Slide 74

Slide 74 text

我只知道, ㊢寫的出來來的東西, 才㈲㊒有所謂的效能可以調校

Slide 75

Slide 75 text

瀏覽器相容性?!

Slide 76

Slide 76 text

其實我不不是很在乎.. XD

Slide 77

Slide 77 text

工商服務 photo by North Carolina Digital Heritage Center

Slide 78

Slide 78 text

- Senior art designer - Mobile app developer 尋找..

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

750+ attendees in 2013

Slide 81

Slide 81 text

750+ attendees in 2013

Slide 82

Slide 82 text

450 tickets sold out in 4 mins

Slide 83

Slide 83 text

WebConf Taiwan 2014

Slide 84

Slide 84 text

Will be held in Jan 2014

Slide 85

Slide 85 text

850+ in 2014, hopefully.

Slide 86

Slide 86 text

All about web development

Slide 87

Slide 87 text

fun with us :)

Slide 88

Slide 88 text

Q & A

Slide 89

Slide 89 text

Contact ✓ Website ✓ Blog ✓ Facebook ✓ Twitter ✓ Email ✓ Mobile http://www.eddie.com.tw http://blog.eddie.com.tw https://www.facebook.com/eddiekao https://twitter.com/eddiekao [email protected] +886-928-617-687