ごらくらいふ

プログラミングしたりゲームしたり

「リトル・レディ」かってに復活開発日誌 #10

f:id:yajamon:20150715095909p:plain

今日の課題

  • エフェクト処理を動作させる

目的

  • 意図された演出を体験する

結果

動きました。

f:id:yajamon:20150726183036g:plain

作業録

eventP.js内のdocument.allを全て修正する。

// /js/eventP.js

/////////////////////////////////////
//○レイヤーを前に出す
function zindexL(layName, zindex) {
    document.getElementById(layName).style.zIndex = zindex  //IE用
}

/////////////////////////////////////
//○レイヤーを移動させる
function moveL(layName, x, y) {
    document.getElementById(layName).style.left = y;
    document.getElementById(layName).style.top = x;
}

/////////////////////////////////////
//○レイヤーの背景色を変える
function setBGC(layName, color) {
    document.getElementById(layName).style.backgroundColor = color;
}

/////////////////////////////////////
//○ワイプ 拡大
function setDCLIP(layName, stT, stR, stB, stL, color, endT, endR, endB, endL, step) {
    if (!wipIniFlag) { //--wip ini
        Ct = stT; Cr = stR; Cb = stB; Cl = stL;
        stepT = (Math.max(Ct, endT) - Math.min(Ct, endT)) / step //--step計算
        stepR = (Math.max(Cr, endR) - Math.min(Cr, endR)) / step
        stepB = (Math.max(Cb, endB) - Math.min(Cb, endB)) / step
        stepL = (Math.max(Cl, endL) - Math.min(Cl, endL)) / step
        clipvalue = Ct + ',' + Cr + ',' + Cb + ',' + Cl + ',"'
        clipvalue += color + '",'
        clipvalue += endT + ',' + endR + ',' + endB + ',' + endL + ',' + step
        document.getElementById(layName).style.backgroundColor = color
        wipIniFlag = true
    }
    if (Ct > endT) Ct -= stepT
    if (Cr < endR) Cr += stepR
    if (Cb < endB) Cb += stepB
    if (Cl > endL) Cl -= stepL
    if (!(Ct > endT) && !(Cr < endR) && !(Cb < endB) && !(Cl > endL)) {
        clearTimeout(wiptID);
        wipIniFlag = false;
    } else {
        wiptID = setTimeout('setDCLIP("' + layName + '",' + clipvalue + ')', 10)
    }

    var element = document.getElementById(layName);
    var getFloat = function(val){
        var returnValue = parseFloat(val);
        if(isNaN(returnValue)){
            return 0;
        }
        return returnValue;
    }
    if(getFloat(element.style.width) < Cr) {
        element.style.width = Cr;
    }
    if(getFloat(element.style.height) < Cb) {
        element.style.height = Cb;
    }
    setCLIP(layName, Ct, Cr, Cb, Cl);
}

/////////////////////////////////////
//○ワイプ 縮小
function setDCLIP2(layName, stT, stR, stB, stL, color, endT, endR, endB, endL, step) {
    if (!wipIniFlag) { //--wip ini
        Ct = stT; Cr = stR; Cb = stB; Cl = stL;
        stepT = (Math.max(Ct, endT) - Math.min(Ct, endT)) / step; //--step計算
        stepR = (Math.max(Cr, endR) - Math.min(Cr, endR)) / step;
        stepB = (Math.max(Cb, endB) - Math.min(Cb, endB)) / step;
        stepL = (Math.max(Cl, endL) - Math.min(Cl, endL)) / step;
        clipvalue = Ct + ',' + Cr + ',' + Cb + ',' + Cl + ',"';
        clipvalue += color + '",';
        clipvalue += endT + ',' + endR + ',' + endB + ',' + endL + ',' + step;
        document.getElementById(layName).style.backgroundColor = color;
        wipIniFlag = true;
    }
    if (Ct < endT) Ct += stepT;
    if (Cr > endR) Cr -= stepR;
    if (Cb > endB) Cb -= stepB;
    if (Cl < endL) Cl += stepL;
    if (!(Ct < endT) && !(Cr > endR) && !(Cb > endB) && !(Cl < endL)) {
        clearTimeout(wiptID);
        wipIniFlag = false;
    } else {
        wiptID = setTimeout('setDCLIP2("' + layName + '",' + clipvalue + ')', 10)
    }

    var element = document.getElementById(layName);
    var getFloat = function(val){
        var returnValue = parseFloat(val);
        if(isNaN(returnValue)){
            return 0;
        }
        return returnValue;
    }
    if(getFloat(element.style.width) < Cr) {
        element.style.width = Cr;
    }
    if(getFloat(element.style.height) < Cb) {
        element.style.height = Cb;
    }
    setCLIP(layName, Ct, Cr, Cb, Cl);
}

/////////////////////////////////////
//○ジャンプ・ワイプ
var wipIniFlag = false
var Ct, Cr, Cb, Cl
var wiptID = setTimeout('', 1);

function JwipeCLIP(layName, stT, stR, stB, stL, color, endT, endR, endB, endL, newP, step) {
    if (!wipIniFlag) { //--wip ini
        Ct = stT; Cr = stR; Cb = stB; Cl = stL;
        stepT = (Math.max(Ct, endT) - Math.min(Ct, endT)) / step //--step計算
        stepR = (Math.max(Cr, endR) - Math.min(Cr, endR)) / step
        stepB = (Math.max(Cb, endB) - Math.min(Cb, endB)) / step
        stepL = (Math.max(Cl, endL) - Math.min(Cl, endL)) / step
        clipvalue = Ct + ',' + Cr + ',' + Cb + ',' + Cl + ',"'
        clipvalue += color + '",'
        clipvalue += endT + ',' + endR + ',' + endB + ',' + endL + ',"'
        clipvalue += newP + '",' + step
        document.getElementById(layName).style.backgroundColor = color
        wipIniFlag = true
    }
    if (Ct > endT) Ct -= stepT
    if (Cr < endR) Cr += stepR
    if (Cb < endB) Cb += stepB
    if (Cl > endL) Cl -= stepL
    if (!(Ct > endT) && !(Cr < endR) && !(Cb < endB) && !(Cl > endL)) {
        clearTimeout(wiptID)
        setTimeout('newPage("' + newP + '")', 10)
    } else {
        wiptID = setTimeout('JwipeCLIP("' + layName + '",' + clipvalue + ')', 10)
    }

    var element = document.getElementById(layName);
    var getFloat = function(val){
        var returnValue = parseFloat(val);
        if(isNaN(returnValue)){
            return 0;
        }
        return returnValue;
    }
    if(getFloat(element.style.width) < Cr) {
        element.style.width = Cr;
    }
    if(getFloat(element.style.height) < Cb) {
        element.style.height = Cb;
    }
    setCLIP(layName, Ct, Cr, Cb, Cl);
}


////////////////////
//○キーコードをゲット
function getKC(e) {
    //--押されたキ-コ-ドを返す
    return e.keyCode;
}

yajamon.hatenablog.com

yajamon.hatenablog.com