Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
JavaScript2Dゲームエンジン「swf2js」〜swfも使えるよ〜
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Toshiyuki Ienaga
March 23, 2016
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
JavaScript2Dゲームエンジン「swf2js」〜swfも使えるよ〜
第63回 HTML5とか勉強会 with html5jゲーム部発足記念合同勉強会資料
Toshiyuki Ienaga
March 23, 2016
More Decks by Toshiyuki Ienaga
See All by Toshiyuki Ienaga
AWS Auto Scaling
ienaga
0
120
「swf2js」ではじめるゲーム制作
ienaga
0
4.8k
RedisPlugin
ienaga
0
180
Resurrection Flasher swf2js
ienaga
0
5.2k
Other Decks in Technology
See All in Technology
【dbts2026】AIエージェントの 判断と探索を変える、 データベース エンジニアリング― 既存DBの処理と依存関係から作る、オペレーショナルオントロジー ―
shisyu_gaku
0
180
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
130
AIがGISを代替する日:〜すべてをAIが創る時代に、私たちがFOSS4Gに関わる意味〜
lehupa
1
210
AWSを利用する上で知っておきたい名前解決の話 2026
nagisa53
4
2.8k
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
150
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
180
2026 Apache Flink Community Checkpoint
rmetzger
0
180
Content Mapper APIの応用例~CSS Modules、言語ファイル~
uhyo
2
610
自律的なチームを作るためにTechPMがやらないこと
ny7760
1
510
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
4
270
Consistency for mere mortals - A gentle guide to consistency
ufried
0
120
「いつか使う」の「いつか」は来ない 〜AI駆動開発における「作らない」判断について〜
ikki0006
0
120
Featured
See All Featured
KATA
mclloyd
PRO
35
16k
We Have a Design System, Now What?
morganepeng
55
8.4k
Accessibility Awareness
sabderemane
1
290
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
How to Ace a Technical Interview
jacobian
280
24k
So, you think you're a good person
axbom
PRO
2
2.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
600
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
830
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
570
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
290
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Transcript
JavaScript2Dゲームエンジン 「swf2js」 〜swfも使えるよ〜 2016/3/29 Toshiyuki Ienaga(github.com/ienaga)
⾃⼰紹介 ´家永 稔之(Ienaga Toshiyuki) ´株式会社ソニックムーブ バックエンドエンジニア ´GitHub: ienaga
⼀昔前まではゲームといえば? FLASH
JavaScript 現在、ゲームといえば?
仲良くすればいい! JavaScriptとFLASH…
作りました。 という事で「swf2js」
swf2jsの使い⽅ ´Flasher Style ´Frontend Style
Flasher Style ´これまでFlashでガリガリ開発されていた⽅ ´既存のSWFを再利⽤したい⽅
HTMLに2⾏追加するだけ! <html> <head> <script type="text/javascript" src="swf2js.js"></script> </head> <body> <script type="text/javascript">
swf2js.load("./sample.swf"); </script> </body> </html> ①headerにswf2js.jsの本体を読み込む。 ②再⽣したいswfのURLを書く
サンプル ´ http://ienaga.github.io/swf2js/sample.html?sample/lines.swf ´ http://ienaga.github.io/swf2js/sample.html?sample/yomi.swf ´ サンプル提供:GAMEDESIGN
Frontend Style ´CreateJSなどのJS制作経験のある⽅ ´複数⼈での開発をしたい⽅ ´ 例):アニメーションはSWFで、各種ページの動作はJS ´とにかくJavaScriptで作りたい⽅
はじめにRootの作成 /** * @param int width * @param int height
* @param int * @param object options ** / var _root = swf2js.createRootMovieClip(240, 240, 30);
APIドキュメント ´https://swf2js.wordpress.com/api/
外部サーバーからswfを読み込む // rootに空のMovieClipを追加 var model = _root.createMovieClip("model"); // 外部swfを読み込み model.loadMovie("model.swf");
// 座標をセット model.x = 50; model.y = 10;
⾃作で描画する // rootに空のMovieClipを追加 var shapes = _root.createMovieClip(”shapes"); // Shapeを追加 var
shape = shapes.createShape(); // ランダムに⾊を設定 var hue = 360 * Math.random(); var color = "hsl(" + hue + ", 100%, 50%)"; // ランダムに円を描画 shape.graphics .beginFill(color) .drawCircle(0, 0, Math.floor(20 * Math.random()));
サンプル ´http://ienaga.github.io/swf2js/sample4.html
ご清聴ありがとうございました。