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
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
95
「swf2js」ではじめるゲーム制作
ienaga
0
4.7k
RedisPlugin
ienaga
0
160
Resurrection Flasher swf2js
ienaga
0
5.2k
Other Decks in Technology
See All in Technology
生成AI時代におけるAI・機械学習技術を用いたプロダクト開発の深化と進化 #BetAIDay
layerx
PRO
1
880
Findy Freelance 利用シーン別AI活用例
ness
0
150
ホリスティックテスティングの右側も大切にする 〜2つの[はか]る〜 / Holistic Testing: Right Side Matters
nihonbuson
PRO
0
450
robocopy の怖い話/scary-story-about-robocopy
emiki
0
440
データエンジニアがクラシルでやりたいことの現在地
gappy50
3
820
AI コードレビューが面倒すぎるのでテスト駆動開発で解決しようとして読んだら、根本的に俺の勘違いだった
mutsumix
0
150
2025-07-31: GitHub Copilot Agent mode at Vibe Coding Cafe (15min)
chomado
2
310
LLMをツールからプラットフォームへ〜Ai Workforceの戦略〜 #BetAIDay
layerx
PRO
1
720
フィードバック駆動での AI の育て方
yoshizaki
1
110
Vision Language Modelと自動運転AIの最前線_20250730
yuyamaguchi
3
1.1k
【CEDEC2025】ブランド力アップのためのコンテンツマーケティング~ゲーム会社における情報資産の活かし方~
cygames
PRO
0
220
AWS re:Inforce 2025 re:Cap Update Pickup & AWS Control Tower の運用における考慮ポイント
htan
1
170
Featured
See All Featured
For a Future-Friendly Web
brad_frost
179
9.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.5k
What's in a price? How to price your products and services
michaelherold
246
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Statistics for Hackers
jakevdp
799
220k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Side Projects
sachag
455
43k
Optimizing for Happiness
mojombo
379
70k
The Cult of Friendly URLs
andyhume
79
6.5k
Building an army of robots
kneath
306
45k
A Modern Web Designer's Workflow
chriscoyier
695
190k
Code Reviewing Like a Champion
maltzj
524
40k
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
ご清聴ありがとうございました。