Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
CreateJS - from Flash to Javascript
Search
高見龍
May 19, 2013
Programming
4.2k
27
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
CreateJS - from Flash to Javascript
高見龍
May 19, 2013
More Decks by 高見龍
See All by 高見龍
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
630
自己的售票系統自己做!
eddie
0
650
AI Agent 時代的開發者生存指南
eddie
4
2.8k
print("Hello, World")
eddie
2
670
為你自己學 Python - 冷知識篇
eddie
1
480
為你自己學 Python
eddie
0
780
Generative AI 年會小聚 - AI 教我寫程式
eddie
0
240
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
790
AI 時代的程式語言學習法
eddie
0
290
Other Decks in Programming
See All in Programming
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
190
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
680
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
470
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.7k
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
490
ここ半年くらいでAIに作らせたR用ツール
eitsupi
0
380
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
870
Cloudflare is Agents
chimame
0
170
VibeCodingからAgenticWorkflowへ
starfish719
0
470
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
220
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
【やさしく解説 設計編・中級 #6】良いアーキテクチャとは ~ 一本の登り道の、行き先 ~
panda728
PRO
0
210
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Documentation Writing (for coders)
carmenintech
77
5.4k
Docker and Python
trallard
47
4.1k
Practical Orchestrator
shlominoach
191
12k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
480
The untapped power of vector embeddings
frankvandijk
2
1.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
200
The Spectacular Lies of Maps
axbom
PRO
1
910
We Are The Robots
honzajavorek
0
300
Transcript
CreateJS 從 Flash 到 JavaScript
None
I’m a Ruby guy ≈ 4 years
but also a Flash guy ≈ 8 years
目前狀狀態 80% iOS app, 20% Ruby / Rails
None
None
CreateJS 從 Flash 到 JavaScript
在開始之前..
武林林㆗㊥中, 曾流流傳著許多的 Flash 殺殺手..
Flash 真的死了了嗎?
可能吧 :)
Flash Play != Flash
None
如果你曾經是個 Flash 程式設計師 或是現在還靠 Flash 討生活...
該㈻㊫學 HTML5 嗎?
聽說說說 HTML5 的 Canvas ㈲㊒有點難?!
Grant Skinner photo by Andy Polaine http://gskinner.com/
http://www.createjs.com
EaselJS .. provides a full, hierarchical display list, a core
interaction model, and helper classes to make working with the HTML5 Canvas element much easier.
TweenJS A simple but powerful tweening / animation library for
Javascript. Part of the CreateJS suite of libraries.
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.
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.
原因?
CreateJS 是 真.大神神㊢寫的!
None
None
Flash-like 的 API
㈲㊒有文件、範例例!
授權?
MIT
Flash == Commercial software
Flash != Not Open
安裝
✴ 就放在你的專案裡裡.. ✴ 或是直接從 CDN 引入.. 安裝 <script src="lib/createjs.js"></script> <script
src="http://code.createjs.com/createjs-2013.05.14.min.js"> </script>
None
哈囉,世界!
哈囉,世界 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();
等等! 剛剛的程式碼裡裡面是不不是㈲㊒有看到 "Stage" 跟 "addChild"..?!
應該是巧合吧 反正程式都都嘛長得很像.. :)
小圈圈
畫圈圈 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();
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(); 畫圈圈
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(); 畫圈圈
親愛的, 剛剛是不不是㈲㊒有看到 "Graphics" 跟 "Shape",還㈲㊒有㆒㈠㊀一些熟悉的畫線、 畫圈圈跟著色的方法..?!
旋轉吧,方塊!
旋轉吧,方塊! 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(); }
Classes in EaselJS
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.
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.
親愛的 Flasher 們, ㈲㊒有種回家、熟悉的感動了了嗎..
Container A nestable display container, which lets you aggregate display
objects and manipulate them as a group.
㆒㈠㊀一層包㆒㈠㊀一層
Text Renders a single line of text to the stage.
Bitmap Draws an image, video or canvas to the canvas
according to its display properties.
Shape Renders a Graphics object within the context of the
display list.
Graphics Provides an easy to use API for drawing vector
data. Can be used with Shape, or completely stand alone.
Filter The base filter class that other filters (ex. BoxBlurFilter,
ColorMatrixFilter, etc) extend.
Ticker Provides a pausable centralized tick manager for ticking Stage
instances or other time based code.
Rectangle Represents a rectangle as defined by the points (x,
y) and (x +width, y+height).
SpriteSheet Encapsulates all the data associated with a sprite sheet
to be used with BitmapAnimation.
動畫!
None
But!
好啦, 我知道你們㊢寫程式的都都很厲害..
我是美術設計師, 只會畫圖以及用 Flash 拉拉時間軸 做動畫,㊢寫些簡單的 gotoAndPlay( )
工具包?!
Zoë A stand alone tool for exporting SWF animations as
EaselJS sprite sheets that can be used in Canvas and CSS.
CreateJS toolkits
改得動嗎?!
匯出檔案大小?!
效能?!
我沒㈲㊒有評估過所㈲㊒有的 javascript libs..
我只知道, ㊢寫的出來來的東西, 才㈲㊒有所謂的效能可以調校
瀏覽器相容性?!
其實我不不是很在乎.. XD
工商服務 photo by North Carolina Digital Heritage Center
- Senior art designer - Mobile app developer 尋找..
None
750+ attendees in 2013
750+ attendees in 2013
450 tickets sold out in 4 mins
WebConf Taiwan 2014
Will be held in Jan 2014
850+ in 2014, hopefully.
All about web development
fun with us :)
Q & A
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