// ************** 03_10 **************

// *********************** (04) ジェスチャー ********************************

// *********************** sample4(gesture) *********************************

//var buttonHeight = 35; //上部のボタンの高さ

//var fontSize = 20;     //ボタンに表示される文字の大きさ

var curX = screenWidth/2;

var curY = screenHeight/2;

//var imgWidth = 768;

//var imgHeight = 1024;

var imgWidth = 500;  //18.10.15 update

var imgHeight = 667; //18.10.15 update

var img = new Image();

function setup(){

        img.src = "img/face.png";

}

function loop(){

        //描画

        pbCtx.clearRect(0, 0, screenWidth, screenHeight);

        pbCtx.save();

        pbCtx.translate(curX, curY);

        pbCtx.drawImage(img, -imgWidth/2, -imgHeight/2, imgWidth, imgHeight);

        pbCtx.restore();

        //ボタンの描画

        //pbCtx.lineWidth = 1;

        //pbCtx.textAlign = "center";

        //pbCtx.font = fontSize+"px 'Times New Roman'";

        //pbCtx.fillStyle = "black";

        //pbCtx.beginPath();

        //pbCtx.rect(0, 0, screenWidth, buttonHeight);

        //pbCtx.fill();

        //pbCtx.fillStyle = "white";

        //pbCtx.fillText("3-10 下記古堅先生の顔を、指で摘まんで位置のみ動かせます",

                //screenWidth/2, buttonHeight/2+fontSize/3);

}

function onPressed(n){

}

function onMove(n){

        if(yubiNum == 2){

                curX = (yubiX[0] + yubiX[1])/2;

                curY = (yubiY[0] + yubiY[1])/2;

        }

}

function onReleased(n){

        

}