SlideShare a Scribd company logo
ZENER NET WORKS
  2013/02/28
     sanoh
1.HTML5に将来はあるのか?
2.Webアプリ開発
3.開発環境準備
4.開発サンプル
HTML5って必要?
1.HTML5に将来はあるのか?
2.WEBアプリ開発
3.開発環境準備
4.開発サンプル
スマートフォン(iPhone、Android、
WindowsPhone8)
スレートPC(iPad、Kindol)
スマートTV(AppleTV、GoogleTV、
KindolTV)
ディスクトップ(Windows、Mac)
コンシューマ(PS3、XBOX360、WiiU)
携帯ゲーム機(PSP、3DS)
HTML5って必要?
HTML5って必要?
HTML5って必要?
課金
ストア   ストア     ストア
 課金    課金      課金



      ソーシャル
      グラフ     リアル
              グラフ   利益

利益

       利益
              利益
ブラウザで
 動作する
コンテンツ
チッリなコンテンツ

Flash? VS HTML5?
1.HTML5に将来はあるのか?
2.Webアプリ開発
3.開発環境準備
4.開発サンプル
FLASH               Java          Silverlight


HTML5               Ajax                CSS

          JavaScrpt(JQuery,Json・・・)


                    HTML


       HTTP                      XML


Perl           PHP(Cake,Zend)     C#(ASP・・)


MySQL             SQL Azure            Postgre

Linux             クラウド(Amazon,Azure・・・・)
HTML5

        JavaScrpt


          HTML
Canvas
SVG
Audio
Video
WebSocket
WebWorker
WegStorage
WebGL
Desktop                     iPhone          Android2.3
            IE9   FireFox   Chrome   Safari   Safari   Chrome   標準   FireFox
                  15.0.1     21.0    5.1.7     5.1       12           15.0.1

Canvas      ○       ○        ○        ○        ○        ○       ○      ○
SVG         ○       ○        ○        ○        ○        ○       ○      ○
Audio       ○       ○        ○        ○        ○        ○       ○      ○
Video       ○       ○        ○        ○        ○        ○       ○      ○
WebSocket   X       ○        ○        ○        ○        ○       X      ○
WebWorker   X       ○        ○        ○        ○        ○       X      ○
WebStrage   ○       ○        ○        ○         -        -      -      -
WebGL       X       X        ○         X        X        X      X      ○
1.HTML5に将来はあるのか?
2.Webアプリ開発
3.開発環境準備
4.開発サンプル
3.1 デバッグ環境
3.2 ローカルサーバ環境
3.3 環境の選定
IE9
F12
Firefox
Firebug(エクステンション)
Safari
Web   Inspector
Chrome
 Chromeデベロッパーツール
VisualStudio2010 / WebMatrix2
XAMPP
VirtualPC
VMware
Azure
IIS
Apache
HTML5                HTML5

 JavaScript(JQuery)   JavaScript(JQuery)



Apache      CakePHP    IIS          MVC-3、4


              PHP                   ASP.NET

             MySQL            WindowsServer
1.HTML5に将来はあるのか?
2.Webアプリ開発
3.開発環境準備
4.開発サンプル
4.1   表示
4.2   動きのある表示
4.3   色加算
4.4   パフォーマンス
4.5   Lib化
4.6   入力
4.7   ブラウザ互換
4.8   ページ遷移
4.9   バグの出にくいソース?
HTMK5
http://ie.microsoft.com/testdrive/


http://worldsbiggestpacman.com/play/#-7,6
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Sample001.html</title>

<script>
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");
}
</script>

</head>
<body onload="draw()">
<canvas id="canvas1" width="300" height="300"></canvas>
</body>
</html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Sample002.html</title>

<script>
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");
    c.font = "38px 'MS Gothic'";
    c.fillStyle = "#666666";
    c.fillText("こんにちは", 100, 100);
}
</script>

</head>
<body onload="draw()">
<canvas id="canvas1" width="300" height="300"></canvas>
</body>
</html>
:
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

        c.fillStyle = "#0099ff";
        c.fillRect (15, 15, 50, 45);

        c.fillStyle = "rgba(0, 0, 200, 0.5)";
        c.fillRect (30, 30, 50, 45);
}
    :
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

    c.strokeStyle = "#ff9900";
    c.beginPath();
    c.arc(70, 70, 60, 0, Math.PI*2, false);
    c.stroke();
}

function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

    c.fillStyle = "#990099";
    c.beginPath();
    c.arc(70, 70, 60, 0, Math.PI*2, false);
    c.fill();
}
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

    c.fillStyle = "#999999";
    c.beginPath();
    c.moveTo(10,10);
    c.lineTo(200,50);
    c.lineTo(100,120);
    c.closePath();
    c.fill();
}
function draw() {
                                                       Onloadなので読み込み終
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");
                                                       了してない

    var img = new Image();
    img.src = "img/grand001.png";
    c.drawImage(img, 0, 0);
}
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

    var img = new Image();
    img.src = "img/grand001.png";
    c.drawImage(img, 0, 0, 640, 480);
}
function draw() {
    var canvas = document.getElementById("canvas1");
    var c = canvas.getContext("2d");

    var img = new Image();
    img.src = "img/tree001.png";
    c.drawImage(img, 10, 10, 64, 64, 100, 100, 128, 32);
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8"/>
<title>Sample002.html</title>
<script>//<![CDATA[

var timerInterval = 25; //25msec
var timer1;
var c;

function draw() {
}

function init(){
    var canvas = document.getElementById("canvas1");
    c = canvas.getContext("2d");

    timer1 = setInterval("draw()", timerInterval);
}

//]]></script>
</head>
<body onload="init()">
<canvas id="canvas1" width=“300" height=“300"></canvas>
</body>
</html>
<script>//<![CDATA[

var   timerInterval = 25; //25msec                         イメージの読み
var   timer1;
var   c;                                                   込み終了を待つ
var   img;

function draw() {
}

function init(){
    var canvas = document.getElementById("canvas1");
    c = canvas.getContext("2d");

      img = new Image();
      img.src = "img/grand001.png";

      img.onload = function(){
          draw();
          timer1 = setInterval("draw()", timerInterval);
      }
}

//]]></script>
<script>//<![CDATA[

var timerInterval = 25; //25msec
var timer1;

var c;
var img;

var angle = 3;
function draw() {
  c.fillStyle = "#c0c0c0";
  c.fillRect (0, 0, 300, 300);

    c.rotate(angle * Math.PI / 180);
    c.drawImage(img, 0, 0);
}

function init(){
    var canvas = document.getElementById("canvas1");
    c = canvas.getContext("2d");

     img = new Image();
     img.src = "img/grand001.png";
     img.onload = function(){
         draw();
         timer1 = setInterval("draw()", timerInterval);
      }
}

//]]></script>
HTML5って必要?
<script>                                                     function Draw(){
Var draw;                                                        draw.clearRect(0, 0, windWidth, windHeight);
Var img;
                                                                 draw.fillStyle         = "#000000";
Var partX;
                                                                 draw.fillRect(0, 0, windWidth, windHeight);
Var partY;
Var partAX;
Var partAY;                                                      draw.globalCompositeOperation        = "lighter";
                                                                 for( var i = 0 ; i < partX.length ; i++ ){
function init() {                                                    draw.drawImage(img, partX[i], partY[i]);
    var max = 60;                                                    //-----------------------------------------
    var outputcanvas = document.getElementById("canvas1");           partX[i]           += partAX[ i ];
    var ang;                                                         if( partX[i] < -128 )
                                                                     partAX[i]          = -partAX[i];
    per = new Performance();                                         if( partX[i] > windWidth-128 )
    draw = outputcanvas.getContext("2d");                                partAX[i]      = -partAX[i];
    setInterval(“Draw()", 16.7);
                                                                     partY[i]           += partAY[ i ];
    windWidth = outputcanvas.width;
    windHeight = outputcanvas.height;                                if( partY[i] < -128 )
    //--------------------------------------                             partAY[i]      = -partAY[i];
    img = new Image();                                               if( partY[i] > windHeight-128 )
    img.src = "../img/ball.png";                                         partAY[i]      = -partAY[i];
    //--------------------------------------                     }
    partX = Array( max );                                        draw.globalCompositeOperation        = "source-over";
    partY = Array( max );
    partAX = Array( max );                                   }
    partAY = Array( max );
    for( var i = 0 ; i < max ; i++ ){                        </script>
        partX[i] = Math.random() * (windWidth-128);
                                                             </head>
        partY[i] = Math.random() * (windHeight-128);
                                                             <body onload="init()">
        Ang   = Math.random() * Math.PI * 2;
        partAX[i] = Math.sin( ang );                         <canvas id="canvas1" width="640" height="400"></canvas>
        partAY[i] = Math.sin( ang );                         </body>
    }                                                        </html>
}
HTML5って必要?
<script language="JavaScript“
                    src="./Performance.js"></script>

                                                       function     Performance(){
                                                           this.startTime = new Date();
var            per;                                        this.endTime = new Date();
                                                           this.fpsTime = 0;
function init() {
                                                           this.Start = function(){
      per      = new Performance();                            this.startTime = new Date();
                                                               this.fpsTime = this.startTime - this.endTime;
                                                               this.endTime = this.startTime;
                                                           }
function Draw(){                                           this.GetFPS = function( fr ){
    var      fps;                                              return Math.min(Math.floor(1000/this.fpsTime), fr )
    per.Start();                                           }
    fps      = per.GetFPS(60);                         }

             : 描画

      draw.font = "128px 'MS Gothic'";
      draw.fillStyle = "#ff0000";
      draw.fillText("FPS="+fps, 100, 150);
}
HTML5って必要?
Var     Glib        = function(name){                            this.DrawPolygon3 = function(   x1, y1, x2, y2, x3, y3 ){
      this.canvas = document.getElementById(name);                   this.g.beginPath();
      this.g        = this.canvas.getContext("2d");                  this.g.moveTo(x1,y1);
      this.canvasW = this.canvas.width;                              this.g.lineTo(x2,y2);
      this.canvasH = this.canvas.height;                             this.g.lineTo(x3,y3);
      this.g.lineWidth = 1;                                          this.g.closePath();
      this.Cls = function() {                                        this.g.fill();
           this.g.clearRect(0, 0, this.canvasW, this.canvasH);   }
           this.Push();                                          this.DrawPolygon3 = function(   x1, y1, x2, y2, x3, y3, s ){
      }                                                              this.g.fillStyle = s;
      this.Cls = function(s) {                                       this.g.beginPath();
           this.g.fillStyle = s;                                     this.g.moveTo(x1,y1);
           this.g.fillRect(0, 0, this.canvasW, this.canvasH);        this.g.lineTo(x2,y2);
           this.Push();                                              this.g.lineTo(x3,y3);
      }                                                              this.g.closePath();
      this.Draw = function() {                                       this.g.fill();
           this.Pop();                                           }
      }                                                          this.DrawPolygon4 = function(   x1, y1, x2, y2, x3, y3, x4, y4 ){
      this.SetColor = function( s ){                                 this.g.beginPath();
           this.g.fillStyle = s;                                     this.g.moveTo(x1,y1);
      }                                                              this.g.lineTo(x2,y2);
      this.DrawBox = function( x, y, w, h ){                         this.g.lineTo(x3,y3);
           this.g.fillRect ( x, y, w, h);                            this.g.lineTo(x4,y4);
      }                                                              this.g.closePath();
      this.DrawBox = function( x, y, w, h, s ){                      this.g.fill();
           this.g.fillStyle = s;                                 }
           this.g.fillRect ( x, y, w, h);                        this.DrawPolygon4 = function(   x1, y1, x2, y2, x3, y3, x4, y4, s ){
      }                                                              this.g.fillStyle = s;
      this.DrawLine = function( x1, y1, x2, y2 ){                    this.g.beginPath();
           this.g.lineWidth = 2;                                     this.g.moveTo(x1,y1);
           this.g.beginPath();                                       this.g.lineTo(x2,y2);
           this.g.moveTo(x1,y1);                                     this.g.lineTo(x3,y3);
           this.g.lineTo(x2,y2);                                     this.g.lineTo(x4,y4);
           this.g.closePath();                                       this.g.closePath();
           this.g.stroke();                                          this.g.fill();
      }                                                          }
      this.DrawLine = function( x1, y1, x2, y2, s ){
           this.g.strokeStyle = s;
           this.g.beginPath();
           this.g.moveTo(x1,y1);
           this.g.lineTo(x2,y2);
           this.g.closePath();
           this.g.stroke();
      }
this.DrawImage = function( img, x, y ){
        this.g.drawImage(img, x, y);
    }
    this.DrawImage4 = function( img, x, y, w, h ){
        this.g.drawImage(img, x, y, w, h);
    }
    this.DrawImageObj = function( img, sx, sy, sw, sh ){
        this.g.drawImage(img, sx, sy, sw, sh, 0, 0, sw, sh);
    }
    this.DrawImage6 = function( img, sx, sy, sw, sh, x, y){
        this.g.drawImage(img, sx, sy, sw, sh, x, y, sw, sh);
    }
    this.DrawImage8 = function( img, sx, sy, sw, sh, x, y, w, h ){
        this.g.drawImage(img, sx, sy, sw, sh, x, y, w, h);
    }
    this.Pos     = function( x, y ){
        this.g.translate( x, y );
    }
    this.Ang     = function( a ){
        this.g.rotate( a )
    }
    this.Push    = function(){
        this.g.save();
    }
    this.Pop     = function(){
        this.g.restore();
    }
};
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
                                                          Lib化して楽しよう
<meta charset="utf-8"/>
<title>Test</title>

<script language="JavaScript" src="./Glib.js"></script>
<script>//<![CDATA[
var timerInterval = 16.7;
Var g;
var imgTmy;

function draw() {
    g.Cls("#0000ff");
    g.DrawImage( imgTmy, 40, 40);
    g.DrawLine( 0, 0, 250, 200, "#00ffff");
    g.Draw();
}
function init(){
    g            = new Glib( "canvas1");
    setInterval("draw()", timerInterval);

    imgTmy = new Image();
    imgTmy.src = "./grand001.png";
}

//]]></script>
</head>
<body onload="init()">
<canvas id="canvas1" width="300" height="300"></canvas>
</body>
</html>
HTML5って必要?
SmileBoom Petit Developer
スマイルブーム

Enchant.js
Ubiquitous Entertainment Inc

FLASH
Unity
<script>//<![CDATA[
window.document.onkeydown = click_down;   イベントでキャッチ
window.document.onkeyup = click_up;

function click_down()   {
    if( event.keyCode   == 37 )
        my_add_x        = 256*2;
    if( event.keyCode   == 39 )
        my_add_x        =-256*2;
}

function click_up() {
    if( event.keyCode   ==   37 )
        my_add_x        =    0;
    if( event.keyCode   ==   39 )
        my_addx         =    0;
}

//]]></script>
function   myGetBrowser(){
    myOP   = (navigator.userAgent.indexOf("Opera",0) != -1)?1:0; //OP
    myN6   = document.getElementById; // N6 or IE
    myIE
    myN4
           = document.all;
           = document.layers;
                                       // IE
                                       // N4
                                                                        昔はブラウザ依存を
    if (myOP){                           // OP?
        document.onmousemove = myMoveOP;
    }else if (myIE){                     // IE?
                                                                        気負つける必要が
        document.onmousemove = myMoveIE;
    }else if (myN6){                     // N6?
        window.addEventListener("mousemove",myMoveN6,true);
    }else if (myN4){                     // N4?
                                                                        あった。
        window.captureEvents(Event.MOUSEMOVE);
        window.onmousemove = myMoveN4;
    }
    document.addEventListener("touchstart", touchHandler, false);
    document.addEventListener("touchmove", touchHandler, false);
    document.addEventListener("touchend", touchHandler, false);
}

function touchHandler(event) {
    Xpos = event.touches[0].pageX;
    Ypos = event.touches[0].pageY;
    Catch();
}
function myMoveOP(){ // OPŃ}EX
    Xpos = window.event.clientX;
    Ypos = window.event.clientY;
    Catch();
}
function myMoveN6(myEvent){ // N6Ń}EX
    Xpos = myEvent.clientX + window.pageXOffset;
    Ypos = myEvent.clientY + window.pageYOffset;
    Catch();
}
function myMoveIE(){ // IEŃ}EX
    Xpos = window.event.clientX + document.body.scrollLeft;
    Ypos = window.event.clientY + document.body.scrollTop;
    Catch();
}
function myMoveN4(myEvent){ // N4Ń}EX
    Xpos = myEvent.x;
    Ypos = myEvent.y;
    Catch();
}
JQuery




    Googleを使う
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
</script>
ページ切り替え     中身切り替え

          <body>
           <div id="MainFrame">
          </body>
          </html>
var命令による変数宣言は省略しない
  比較演算子は「==」ではなく「===」を
  配列の生成にはリテラルを使う
  中括弧は省略しない
  文の途中の改行に要注意

http://blog.livedoor.jp/ryo511-web/archives/13577395.html
動かして楽しもう
JavaScript

Flash
Flash11
http://nissan-stagejuk3d.com/



  WebGL
https://code.google.com/p/webglsamples/
やっておいて損はない
質問
Mail: sanoh@zener.co.jp
Blog: http://d.hatena.ne.jp/sanoh/ (ポリゴン魂)
Facebook: 佐野 浩章
Twitter: sanoh00

More Related Content

PDF
A More Flash Like Web?
Murat Can ALPAY
 
PDF
HTML5 - Daha Flash bir web?
Ankara JUG
 
PDF
Google's HTML5 Work: what's next?
Patrick Chanezon
 
PDF
How to build a html5 websites.v1
Bitla Software
 
PDF
The Ring programming language version 1.8 book - Part 65 of 202
Mahmoud Samir Fayed
 
PPTX
Making Games in JavaScript
Sam Cartwright
 
PDF
The Ring programming language version 1.5.4 book - Part 59 of 185
Mahmoud Samir Fayed
 
A More Flash Like Web?
Murat Can ALPAY
 
HTML5 - Daha Flash bir web?
Ankara JUG
 
Google's HTML5 Work: what's next?
Patrick Chanezon
 
How to build a html5 websites.v1
Bitla Software
 
The Ring programming language version 1.8 book - Part 65 of 202
Mahmoud Samir Fayed
 
Making Games in JavaScript
Sam Cartwright
 
The Ring programming language version 1.5.4 book - Part 59 of 185
Mahmoud Samir Fayed
 

What's hot (20)

PDF
The Ring programming language version 1.4.1 book - Part 12 of 31
Mahmoud Samir Fayed
 
PPTX
OGDC2013_Lets remake the wheel_ Mr Nguyen Trung Hung
ogdc
 
PPTX
Ogdc 2013 lets remake the wheel
Son Aris
 
PDF
The Ring programming language version 1.7 book - Part 72 of 196
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 74 of 202
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.1 book - Part 64 of 180
Mahmoud Samir Fayed
 
PDF
Html5 game programming overview
민태 김
 
PDF
The Ring programming language version 1.5.2 book - Part 52 of 181
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.8 book - Part 51 of 202
Mahmoud Samir Fayed
 
PDF
Pixelplant - WebDev Meetup Salzburg
wolframkriesing
 
DOC
Ocr code
wi7sonjoseph
 
PDF
Exploring Canvas
Kevin Hoyt
 
PDF
D3.js workshop
Anton Katunin
 
PDF
The Ring programming language version 1.5.4 book - Part 68 of 185
Mahmoud Samir Fayed
 
PDF
Proga 0622
Atsushi Tadokoro
 
PDF
The Ring programming language version 1.6 book - Part 70 of 189
Mahmoud Samir Fayed
 
PDF
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
Atsushi Tadokoro
 
PDF
The Ring programming language version 1.5.3 book - Part 15 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.2 book - Part 35 of 84
Mahmoud Samir Fayed
 
PPTX
Raspberry Pi à la GroovyFX
Stephen Chin
 
The Ring programming language version 1.4.1 book - Part 12 of 31
Mahmoud Samir Fayed
 
OGDC2013_Lets remake the wheel_ Mr Nguyen Trung Hung
ogdc
 
Ogdc 2013 lets remake the wheel
Son Aris
 
The Ring programming language version 1.7 book - Part 72 of 196
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 74 of 202
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 64 of 180
Mahmoud Samir Fayed
 
Html5 game programming overview
민태 김
 
The Ring programming language version 1.5.2 book - Part 52 of 181
Mahmoud Samir Fayed
 
The Ring programming language version 1.8 book - Part 51 of 202
Mahmoud Samir Fayed
 
Pixelplant - WebDev Meetup Salzburg
wolframkriesing
 
Ocr code
wi7sonjoseph
 
Exploring Canvas
Kevin Hoyt
 
D3.js workshop
Anton Katunin
 
The Ring programming language version 1.5.4 book - Part 68 of 185
Mahmoud Samir Fayed
 
Proga 0622
Atsushi Tadokoro
 
The Ring programming language version 1.6 book - Part 70 of 189
Mahmoud Samir Fayed
 
openFrameworks – パーティクルを動かす、静的配列と動的配列 - 多摩美メディアアートII
Atsushi Tadokoro
 
The Ring programming language version 1.5.3 book - Part 15 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.2 book - Part 35 of 84
Mahmoud Samir Fayed
 
Raspberry Pi à la GroovyFX
Stephen Chin
 
Ad

Viewers also liked (12)

PPTX
mendesain pengujian substantif
gdgdp
 
PPTX
Europe in crisis mode students visiting brussels
Robert Manchin
 
DOCX
Prediksi un ipa 2013
Hery Alazmy
 
PPTX
Microfinance 090907122021-phpapp02
manish435
 
PPT
Hay solución
nenufar19
 
DOCX
International recruitment project report
sarabethm
 
PPTX
The good the bad and the ugly: how to design an effective survey
SiREN_WA
 
PDF
Greenedek
Joe Greene
 
PPTX
Livro dos Espíritos questao 179 Evangelho Cap 13 Item 3
Patricia Farias
 
PPTX
Beyond the Search in FamilySearch
Carol Petranek
 
DOC
Magia en el internet
joancarlosr
 
PPTX
Educational Philosophy- an introduction
Supriya Prathapan
 
mendesain pengujian substantif
gdgdp
 
Europe in crisis mode students visiting brussels
Robert Manchin
 
Prediksi un ipa 2013
Hery Alazmy
 
Microfinance 090907122021-phpapp02
manish435
 
Hay solución
nenufar19
 
International recruitment project report
sarabethm
 
The good the bad and the ugly: how to design an effective survey
SiREN_WA
 
Greenedek
Joe Greene
 
Livro dos Espíritos questao 179 Evangelho Cap 13 Item 3
Patricia Farias
 
Beyond the Search in FamilySearch
Carol Petranek
 
Magia en el internet
joancarlosr
 
Educational Philosophy- an introduction
Supriya Prathapan
 
Ad

Similar to HTML5って必要? (20)

KEY
The Canvas API for Rubyists
deanhudson
 
PPT
HTML5 Canvas
Robyn Overstreet
 
PDF
Writing a Space Shooter with HTML5 Canvas
Steve Purkis
 
KEY
Fabric.js — Building a Canvas Library
Juriy Zaytsev
 
PDF
HTML5 Canvas - The Future of Graphics on the Web
Robin Hawkes
 
KEY
Stupid Canvas Tricks
deanhudson
 
KEY
Exploring Canvas
Kevin Hoyt
 
PDF
Intro to HTML5 Canvas
Juho Vepsäläinen
 
PDF
Is HTML5 Ready? (workshop)
Remy Sharp
 
PDF
Is html5-ready-workshop-110727181512-phpapp02
PL dream
 
PDF
Fabric.js @ Falsy Values
Juriy Zaytsev
 
PPT
Rotoscope inthebrowserppt billy
nimbleltd
 
KEY
5 tips for your HTML5 games
Ernesto Jiménez
 
PPTX
Advanced html5 diving into the canvas tag
David Voyles
 
PPTX
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
David Isbitski
 
PDF
HTML5: where flash isn't needed anymore
Remy Sharp
 
PPTX
HTML5 Animation in Mobile Web Games
livedoor
 
PDF
High Performance Mobile Web Game Development in HTML5
Sangmin Shim
 
KEY
Web Grafik Technologien
n3xd software studios ag
 
PDF
Power of canvas
chrismartinez99
 
The Canvas API for Rubyists
deanhudson
 
HTML5 Canvas
Robyn Overstreet
 
Writing a Space Shooter with HTML5 Canvas
Steve Purkis
 
Fabric.js — Building a Canvas Library
Juriy Zaytsev
 
HTML5 Canvas - The Future of Graphics on the Web
Robin Hawkes
 
Stupid Canvas Tricks
deanhudson
 
Exploring Canvas
Kevin Hoyt
 
Intro to HTML5 Canvas
Juho Vepsäläinen
 
Is HTML5 Ready? (workshop)
Remy Sharp
 
Is html5-ready-workshop-110727181512-phpapp02
PL dream
 
Fabric.js @ Falsy Values
Juriy Zaytsev
 
Rotoscope inthebrowserppt billy
nimbleltd
 
5 tips for your HTML5 games
Ernesto Jiménez
 
Advanced html5 diving into the canvas tag
David Voyles
 
Building Windows 8 Metro Style casual games using HTML5 and JavaScript
David Isbitski
 
HTML5: where flash isn't needed anymore
Remy Sharp
 
HTML5 Animation in Mobile Web Games
livedoor
 
High Performance Mobile Web Game Development in HTML5
Sangmin Shim
 
Web Grafik Technologien
n3xd software studios ag
 
Power of canvas
chrismartinez99
 

Recently uploaded (20)

PDF
Sunset Boulevard Student Revision Booklet
jpinnuck
 
PDF
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
PPTX
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
PPTX
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
PDF
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTX
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
PPTX
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
DOCX
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
PPTX
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
PPTX
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PPTX
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
PPTX
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
PDF
Virat Kohli- the Pride of Indian cricket
kushpar147
 
PPTX
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
PPTX
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
PPTX
Care of patients with elImination deviation.pptx
AneetaSharma15
 
PPT
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
PPTX
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
PPTX
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
PDF
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 
Sunset Boulevard Student Revision Booklet
jpinnuck
 
BÀI TẬP TEST BỔ TRỢ THEO TỪNG CHỦ ĐỀ CỦA TỪNG UNIT KÈM BÀI TẬP NGHE - TIẾNG A...
Nguyen Thanh Tu Collection
 
CONCEPT OF CHILD CARE. pptx
AneetaSharma15
 
An introduction to Prepositions for beginners.pptx
drsiddhantnagine
 
1.Natural-Resources-and-Their-Use.ppt pdf /8th class social science Exploring...
Sandeep Swamy
 
PPTs-The Rise of Empiresghhhhhhhh (1).pptx
academysrusti114
 
Python-Application-in-Drug-Design by R D Jawarkar.pptx
Rahul Jawarkar
 
SAROCES Action-Plan FOR ARAL PROGRAM IN DEPED
Levenmartlacuna1
 
How to Manage Leads in Odoo 18 CRM - Odoo Slides
Celine George
 
CARE OF UNCONSCIOUS PATIENTS .pptx
AneetaSharma15
 
PREVENTIVE PEDIATRIC. pptx
AneetaSharma15
 
TEF & EA Bsc Nursing 5th sem.....BBBpptx
AneetaSharma15
 
Virat Kohli- the Pride of Indian cricket
kushpar147
 
Measures_of_location_-_Averages_and__percentiles_by_DR SURYA K.pptx
Surya Ganesh
 
Autodock-for-Beginners by Rahul D Jawarkar.pptx
Rahul Jawarkar
 
Care of patients with elImination deviation.pptx
AneetaSharma15
 
Python Programming Unit II Control Statements.ppt
CUO VEERANAN VEERANAN
 
Kanban Cards _ Mass Action in Odoo 18.2 - Odoo Slides
Celine George
 
How to Close Subscription in Odoo 18 - Odoo Slides
Celine George
 
Antianginal agents, Definition, Classification, MOA.pdf
Prerana Jadhav
 

HTML5って必要?

  • 1. ZENER NET WORKS 2013/02/28 sanoh
  • 9. 課金 ストア ストア ストア 課金 課金 課金 ソーシャル グラフ リアル グラフ 利益 利益 利益 利益
  • 13. FLASH Java Silverlight HTML5 Ajax CSS JavaScrpt(JQuery,Json・・・) HTML HTTP XML Perl PHP(Cake,Zend) C#(ASP・・) MySQL SQL Azure Postgre Linux クラウド(Amazon,Azure・・・・)
  • 14. HTML5 JavaScrpt HTML
  • 16. Desktop iPhone Android2.3 IE9 FireFox Chrome Safari Safari Chrome 標準 FireFox 15.0.1 21.0 5.1.7 5.1 12 15.0.1 Canvas ○ ○ ○ ○ ○ ○ ○ ○ SVG ○ ○ ○ ○ ○ ○ ○ ○ Audio ○ ○ ○ ○ ○ ○ ○ ○ Video ○ ○ ○ ○ ○ ○ ○ ○ WebSocket X ○ ○ ○ ○ ○ X ○ WebWorker X ○ ○ ○ ○ ○ X ○ WebStrage ○ ○ ○ ○ - - - - WebGL X X ○ X X X X ○
  • 19. IE9 F12 Firefox Firebug(エクステンション) Safari Web Inspector Chrome Chromeデベロッパーツール VisualStudio2010 / WebMatrix2
  • 21. HTML5 HTML5 JavaScript(JQuery) JavaScript(JQuery) Apache CakePHP IIS MVC-3、4 PHP ASP.NET MySQL WindowsServer
  • 23. 4.1 表示 4.2 動きのある表示 4.3 色加算 4.4 パフォーマンス 4.5 Lib化 4.6 入力 4.7 ブラウザ互換 4.8 ページ遷移 4.9 バグの出にくいソース?
  • 25. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"/> <title>Sample001.html</title> <script> function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); } </script> </head> <body onload="draw()"> <canvas id="canvas1" width="300" height="300"></canvas> </body> </html>
  • 26. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"/> <title>Sample002.html</title> <script> function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); c.font = "38px 'MS Gothic'"; c.fillStyle = "#666666"; c.fillText("こんにちは", 100, 100); } </script> </head> <body onload="draw()"> <canvas id="canvas1" width="300" height="300"></canvas> </body> </html>
  • 27. : function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); c.fillStyle = "#0099ff"; c.fillRect (15, 15, 50, 45); c.fillStyle = "rgba(0, 0, 200, 0.5)"; c.fillRect (30, 30, 50, 45); } :
  • 28. function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); c.strokeStyle = "#ff9900"; c.beginPath(); c.arc(70, 70, 60, 0, Math.PI*2, false); c.stroke(); } function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); c.fillStyle = "#990099"; c.beginPath(); c.arc(70, 70, 60, 0, Math.PI*2, false); c.fill(); }
  • 29. function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); c.fillStyle = "#999999"; c.beginPath(); c.moveTo(10,10); c.lineTo(200,50); c.lineTo(100,120); c.closePath(); c.fill(); }
  • 30. function draw() { Onloadなので読み込み終 var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); 了してない var img = new Image(); img.src = "img/grand001.png"; c.drawImage(img, 0, 0); }
  • 31. function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); var img = new Image(); img.src = "img/grand001.png"; c.drawImage(img, 0, 0, 640, 480); }
  • 32. function draw() { var canvas = document.getElementById("canvas1"); var c = canvas.getContext("2d"); var img = new Image(); img.src = "img/tree001.png"; c.drawImage(img, 10, 10, 64, 64, 100, 100, 128, 32); }
  • 33. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"/> <title>Sample002.html</title> <script>//<![CDATA[ var timerInterval = 25; //25msec var timer1; var c; function draw() { } function init(){ var canvas = document.getElementById("canvas1"); c = canvas.getContext("2d"); timer1 = setInterval("draw()", timerInterval); } //]]></script> </head> <body onload="init()"> <canvas id="canvas1" width=“300" height=“300"></canvas> </body> </html>
  • 34. <script>//<![CDATA[ var timerInterval = 25; //25msec イメージの読み var timer1; var c; 込み終了を待つ var img; function draw() { } function init(){ var canvas = document.getElementById("canvas1"); c = canvas.getContext("2d"); img = new Image(); img.src = "img/grand001.png"; img.onload = function(){ draw(); timer1 = setInterval("draw()", timerInterval); } } //]]></script>
  • 35. <script>//<![CDATA[ var timerInterval = 25; //25msec var timer1; var c; var img; var angle = 3; function draw() { c.fillStyle = "#c0c0c0"; c.fillRect (0, 0, 300, 300); c.rotate(angle * Math.PI / 180); c.drawImage(img, 0, 0); } function init(){ var canvas = document.getElementById("canvas1"); c = canvas.getContext("2d"); img = new Image(); img.src = "img/grand001.png"; img.onload = function(){ draw(); timer1 = setInterval("draw()", timerInterval); } } //]]></script>
  • 37. <script> function Draw(){ Var draw; draw.clearRect(0, 0, windWidth, windHeight); Var img; draw.fillStyle = "#000000"; Var partX; draw.fillRect(0, 0, windWidth, windHeight); Var partY; Var partAX; Var partAY; draw.globalCompositeOperation = "lighter"; for( var i = 0 ; i < partX.length ; i++ ){ function init() { draw.drawImage(img, partX[i], partY[i]); var max = 60; //----------------------------------------- var outputcanvas = document.getElementById("canvas1"); partX[i] += partAX[ i ]; var ang; if( partX[i] < -128 ) partAX[i] = -partAX[i]; per = new Performance(); if( partX[i] > windWidth-128 ) draw = outputcanvas.getContext("2d"); partAX[i] = -partAX[i]; setInterval(“Draw()", 16.7); partY[i] += partAY[ i ]; windWidth = outputcanvas.width; windHeight = outputcanvas.height; if( partY[i] < -128 ) //-------------------------------------- partAY[i] = -partAY[i]; img = new Image(); if( partY[i] > windHeight-128 ) img.src = "../img/ball.png"; partAY[i] = -partAY[i]; //-------------------------------------- } partX = Array( max ); draw.globalCompositeOperation = "source-over"; partY = Array( max ); partAX = Array( max ); } partAY = Array( max ); for( var i = 0 ; i < max ; i++ ){ </script> partX[i] = Math.random() * (windWidth-128); </head> partY[i] = Math.random() * (windHeight-128); <body onload="init()"> Ang = Math.random() * Math.PI * 2; partAX[i] = Math.sin( ang ); <canvas id="canvas1" width="640" height="400"></canvas> partAY[i] = Math.sin( ang ); </body> } </html> }
  • 39. <script language="JavaScript“ src="./Performance.js"></script> function Performance(){ this.startTime = new Date(); var per; this.endTime = new Date(); this.fpsTime = 0; function init() { this.Start = function(){ per = new Performance(); this.startTime = new Date(); this.fpsTime = this.startTime - this.endTime; this.endTime = this.startTime; } function Draw(){ this.GetFPS = function( fr ){ var fps; return Math.min(Math.floor(1000/this.fpsTime), fr ) per.Start(); } fps = per.GetFPS(60); } : 描画 draw.font = "128px 'MS Gothic'"; draw.fillStyle = "#ff0000"; draw.fillText("FPS="+fps, 100, 150); }
  • 41. Var Glib = function(name){ this.DrawPolygon3 = function( x1, y1, x2, y2, x3, y3 ){ this.canvas = document.getElementById(name); this.g.beginPath(); this.g = this.canvas.getContext("2d"); this.g.moveTo(x1,y1); this.canvasW = this.canvas.width; this.g.lineTo(x2,y2); this.canvasH = this.canvas.height; this.g.lineTo(x3,y3); this.g.lineWidth = 1; this.g.closePath(); this.Cls = function() { this.g.fill(); this.g.clearRect(0, 0, this.canvasW, this.canvasH); } this.Push(); this.DrawPolygon3 = function( x1, y1, x2, y2, x3, y3, s ){ } this.g.fillStyle = s; this.Cls = function(s) { this.g.beginPath(); this.g.fillStyle = s; this.g.moveTo(x1,y1); this.g.fillRect(0, 0, this.canvasW, this.canvasH); this.g.lineTo(x2,y2); this.Push(); this.g.lineTo(x3,y3); } this.g.closePath(); this.Draw = function() { this.g.fill(); this.Pop(); } } this.DrawPolygon4 = function( x1, y1, x2, y2, x3, y3, x4, y4 ){ this.SetColor = function( s ){ this.g.beginPath(); this.g.fillStyle = s; this.g.moveTo(x1,y1); } this.g.lineTo(x2,y2); this.DrawBox = function( x, y, w, h ){ this.g.lineTo(x3,y3); this.g.fillRect ( x, y, w, h); this.g.lineTo(x4,y4); } this.g.closePath(); this.DrawBox = function( x, y, w, h, s ){ this.g.fill(); this.g.fillStyle = s; } this.g.fillRect ( x, y, w, h); this.DrawPolygon4 = function( x1, y1, x2, y2, x3, y3, x4, y4, s ){ } this.g.fillStyle = s; this.DrawLine = function( x1, y1, x2, y2 ){ this.g.beginPath(); this.g.lineWidth = 2; this.g.moveTo(x1,y1); this.g.beginPath(); this.g.lineTo(x2,y2); this.g.moveTo(x1,y1); this.g.lineTo(x3,y3); this.g.lineTo(x2,y2); this.g.lineTo(x4,y4); this.g.closePath(); this.g.closePath(); this.g.stroke(); this.g.fill(); } } this.DrawLine = function( x1, y1, x2, y2, s ){ this.g.strokeStyle = s; this.g.beginPath(); this.g.moveTo(x1,y1); this.g.lineTo(x2,y2); this.g.closePath(); this.g.stroke(); }
  • 42. this.DrawImage = function( img, x, y ){ this.g.drawImage(img, x, y); } this.DrawImage4 = function( img, x, y, w, h ){ this.g.drawImage(img, x, y, w, h); } this.DrawImageObj = function( img, sx, sy, sw, sh ){ this.g.drawImage(img, sx, sy, sw, sh, 0, 0, sw, sh); } this.DrawImage6 = function( img, sx, sy, sw, sh, x, y){ this.g.drawImage(img, sx, sy, sw, sh, x, y, sw, sh); } this.DrawImage8 = function( img, sx, sy, sw, sh, x, y, w, h ){ this.g.drawImage(img, sx, sy, sw, sh, x, y, w, h); } this.Pos = function( x, y ){ this.g.translate( x, y ); } this.Ang = function( a ){ this.g.rotate( a ) } this.Push = function(){ this.g.save(); } this.Pop = function(){ this.g.restore(); } };
  • 43. <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> Lib化して楽しよう <meta charset="utf-8"/> <title>Test</title> <script language="JavaScript" src="./Glib.js"></script> <script>//<![CDATA[ var timerInterval = 16.7; Var g; var imgTmy; function draw() { g.Cls("#0000ff"); g.DrawImage( imgTmy, 40, 40); g.DrawLine( 0, 0, 250, 200, "#00ffff"); g.Draw(); } function init(){ g = new Glib( "canvas1"); setInterval("draw()", timerInterval); imgTmy = new Image(); imgTmy.src = "./grand001.png"; } //]]></script> </head> <body onload="init()"> <canvas id="canvas1" width="300" height="300"></canvas> </body> </html>
  • 46. <script>//<![CDATA[ window.document.onkeydown = click_down; イベントでキャッチ window.document.onkeyup = click_up; function click_down() { if( event.keyCode == 37 ) my_add_x = 256*2; if( event.keyCode == 39 ) my_add_x =-256*2; } function click_up() { if( event.keyCode == 37 ) my_add_x = 0; if( event.keyCode == 39 ) my_addx = 0; } //]]></script>
  • 47. function myGetBrowser(){ myOP = (navigator.userAgent.indexOf("Opera",0) != -1)?1:0; //OP myN6 = document.getElementById; // N6 or IE myIE myN4 = document.all; = document.layers; // IE // N4 昔はブラウザ依存を if (myOP){ // OP? document.onmousemove = myMoveOP; }else if (myIE){ // IE? 気負つける必要が document.onmousemove = myMoveIE; }else if (myN6){ // N6? window.addEventListener("mousemove",myMoveN6,true); }else if (myN4){ // N4? あった。 window.captureEvents(Event.MOUSEMOVE); window.onmousemove = myMoveN4; } document.addEventListener("touchstart", touchHandler, false); document.addEventListener("touchmove", touchHandler, false); document.addEventListener("touchend", touchHandler, false); } function touchHandler(event) { Xpos = event.touches[0].pageX; Ypos = event.touches[0].pageY; Catch(); } function myMoveOP(){ // OPŃ}EX Xpos = window.event.clientX; Ypos = window.event.clientY; Catch(); } function myMoveN6(myEvent){ // N6Ń}EX Xpos = myEvent.clientX + window.pageXOffset; Ypos = myEvent.clientY + window.pageYOffset; Catch(); } function myMoveIE(){ // IEŃ}EX Xpos = window.event.clientX + document.body.scrollLeft; Ypos = window.event.clientY + document.body.scrollTop; Catch(); } function myMoveN4(myEvent){ // N4Ń}EX Xpos = myEvent.x; Ypos = myEvent.y; Catch(); }
  • 48. JQuery Googleを使う <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script>
  • 49. ページ切り替え 中身切り替え <body> <div id="MainFrame"> </body> </html>
  • 50. var命令による変数宣言は省略しない 比較演算子は「==」ではなく「===」を 配列の生成にはリテラルを使う 中括弧は省略しない 文の途中の改行に要注意 http://blog.livedoor.jp/ryo511-web/archives/13577395.html