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
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
0
1.1k
JavaScript2Dゲームエンジン「swf2js」〜swfも使えるよ〜
第63回 HTML5とか勉強会 with html5jゲーム部発足記念合同勉強会資料
Toshiyuki Ienaga
March 23, 2016
Tweet
Share
More Decks by Toshiyuki Ienaga
See All by Toshiyuki Ienaga
AWS Auto Scaling
ienaga
0
100
「swf2js」ではじめるゲーム制作
ienaga
0
4.7k
RedisPlugin
ienaga
0
170
Resurrection Flasher swf2js
ienaga
0
5.2k
Other Decks in Technology
See All in Technology
【Oracle Cloud ウェビナー】[Oracle AI Database + AWS] Oracle Database@AWSで広がるクラウドの新たな選択肢とAI時代のデータ戦略
oracle4engineer
PRO
2
180
AIエージェントに必要なのはデータではなく文脈だった/ai-agent-context-graph-mybest
jonnojun
1
250
顧客の言葉を、そのまま信じない勇気
yamatai1212
1
360
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
Codex 5.3 と Opus 4.6 にコーポレートサイトを作らせてみた / Codex 5.3 vs Opus 4.6
ama_ch
0
200
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
500
登壇駆動学習のすすめ — CfPのネタの見つけ方と書くときに意識していること
bicstone
3
130
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
310
Tebiki Engineering Team Deck
tebiki
0
24k
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
150
ブロックテーマ、WordPress でウェブサイトをつくるということ / 2026.02.07 Gifu WordPress Meetup
torounit
0
200
Featured
See All Featured
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
330
The agentic SEO stack - context over prompts
schlessera
0
650
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
100
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
Ruling the World: When Life Gets Gamed
codingconduct
0
150
Game over? The fight for quality and originality in the time of robots
wayneb77
1
120
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
390
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
190
Believing is Seeing
oripsolob
1
58
Unsuck your backbone
ammeep
671
58k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
220
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
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
ご清聴ありがとうございました。