zoukankan      html  css  js  c++  java
  • lufylegend库 LGraphics绘制图片

    lufylegend库 LGraphics绘制图片

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="UTF-8">
        <title>lufylegend</title>
        <script type="text/javascript" src="lufylegend-1.7.6.js"></script>
    </head>
    
    <body>
        <div id="mylegend">loading...</div>
        <script type="text/javascript">
        var loader;
        init(50, 'mylegend', 500, 350, main);
    
        function main() {
            loader = new LLoader();
            loader.addEventListener(LEvent.COMPLETE, loadBitmapdata);
            loader.load('face.jpg', 'bitmapData');
        }
    
        function loadBitmapdata(event) {
            var bitmapdata = new LBitmapData(loader.content);
            var backLayer = new LSprite();
            addChild(backLayer);
            backLayer.graphics.beginBitmapFill(bitmapdata);
            backLayer.graphics.drawArc(1, '#000', [110, 80, 50, 0, 2 * Math.PI]);
            backLayer.graphics.beginBitmapFill(bitmapdata);
            backLayer.graphics.drawRect(1, '#000', [180, 50, 70, 100]);
            backLayer.graphics.beginBitmapFill(bitmapdata);
            backLayer.graphics.drawVertices(1,'#000',[[120,50],[100,200],[200,150]]);
        }
        </script>
    </body>
    
    </html>
  • 相关阅读:
    4-10
    4-9
    第三章例3-4
    第三章例3-3
    第三章例3-2
    第三章例3-1
    第二章例2-11
    第二章例2-10
    第二章例2-9
    第二章例2-8
  • 原文地址:https://www.cnblogs.com/stono/p/4680003.html
Copyright © 2011-2022 走看看