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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
110
「swf2js」ではじめるゲーム制作
ienaga
0
4.8k
RedisPlugin
ienaga
0
170
Resurrection Flasher swf2js
ienaga
0
5.2k
Other Decks in Technology
See All in Technology
2026-09-10 【Snowflake World Tour Tokyo 2026】dbt Core と Snowflake で実現する多層的なデータガバナンス / Multi-Layered Data Governance Powered by dbt Core and Snowflake
civitaspo
0
310
AIで仕事のやり方を変える
matsu7874
3
1k
ASTを使って影響範囲を特定する
nealle
0
140
AI時代に顧客へ最速で価値を 届けるための試行錯誤 〜「AI × マネジメント」領域におけるmentoのケース〜
posterkeisuke
0
110
『止めない』を設計する — 制約の中で、事業の根幹を支える判断
hiroyaterui
0
260
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
190
【視聴者参加型!】AWSセキュリティアンチパターンクイズ
syoshie
1
490
Sigmaで作る業務アプリ
kazushiro_honma
0
110
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
440
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
150
深夜のクラウド懺悔室 1:29:300 or 1:0:0
kazzpapa3
1
230
Code4Lib JAPANカンファレンス2026 開会挨拶 / Code4Lib JAPAN Conference 2026: Opening Remarks
ykiyota
0
330
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
730
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
510
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
How to make the Groovebox
asonas
2
2.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
230
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
460
Utilizing Notion as your number one productivity tool
mfonobong
4
580
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
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
ご清聴ありがとうございました。