鏡面效果 -電腦資料

電腦資料 時(shí)間:2019-01-01 我要投稿
【m.clearvueentertainment.com - 電腦資料】

   

    將一個(gè)正向的圖形制作成可以水平、豎直,任意翻轉(zhuǎn)的效果,

鏡面效果

。支持動(dòng)態(tài)字體,只支持固定大小設(shè)定。不能檢測(cè)mc的當(dāng)前大小,因?yàn)檎谡滞獾拿娣e以及字體框的面積都會(huì)增加出來(lái)白框。

   

    代碼如下:

    import flash.display.BitmapData;

    import flash.geom.Matrix;

    import com_zszen.spirit.create;

    function mirror(mc:MovieClip,objSet:Object, newMC:String, type:String) {

    var bd:BitmapData = new BitmapData(objSet.width, objSet.height, true, 0);

    var tmc:MovieClip = create.Movie(mc._parent, newMC);

    var bmc:MovieClip = create.Movie(tmc, "mc");

    bd.draw(mc);

    bmc.attachBitmap(bd, 1);

    switch (type) {

    case "h" :

    bmc._x =objSet.width

    bmc._xscale = -100;

    break;

    case "v" :

    bmc._y = objSet.height

    bmc._yscale = -100;

    break;

    case "hv" :

    bmc._x = objSet.width

    bmc._xscale = -100;

    bmc._y =objSet.height

    bmc._yscale = -100;

    break;

    case "vh" :

    bmc._x =objSet.width

    bmc._xscale = -100;

    bmc._y =objSet.height

    bmc._yscale = -100;

    break;

    default :

    }

    return tmc;

    }

    nEnterFrame=function () {

    var tmc = mirror(mc,{width:120,height:106}, "mirrorMe", "h");

    tmc._x = mc._x+119;

    tmc._y = mc._y;

    var tmc = mirror(mc,{width:120,height:106}, "mirrorMe2", "v");

    tmc._x = mc._x;

    tmc._y = mc._y+105;

    var tmc = mirror(mc,{width:120,height:106}, "mirrorMe3", "hv");

    tmc._x = mc._x+119

    tmc._y = mc._y+105;

    };

最新文章