zoukankan      html  css  js  c++  java
  • 转 [教程] [Lii]最小帧速下的强制渲染——自制图像引擎的同学看过来

    var lii:URLLoader = new URLLoader();
    lii.addEventListener(ProgressEvent.PROGRESS,test);
    addEventListener(Event.ENTER_FRAME,init);
    stage.addEventListener(Event.RENDER,render);
    var url:String  = "http://flashdn-nctalk.ktics.co.kr/BnS_20091127/BNS_FullMovie_download.zip";
    var aone:Sprite = new Sprite();
    aone.graphics.beginFill(0xFF0000);
    aone.graphics.drawRect(0,0,100,100);
    aone.graphics.endFill();
    aone.x = aone.y = 100;
    addChild(aone);
    function init(e:Event):void {
            lii.load(new URLRequest(url));
            stage.frameRate = 0.0000001;
            removeEventListener(Event.ENTER_FRAME,init);
    }
    function test(e:ProgressEvent):void {
            aone.x +=.1;
            aone.rotation += 1;
            stage.invalidate();
            stage.quality = StageQuality.HIGH;
    }
    function render(e:Event):void {
            trace("render");
            //不会触发render事件的渲染
    }
     

    trace(1 / 0.0000001 / 60 / 60,"小时/帧") //2777.777777777778 小时/帧 

    事实上,没有什么要比发现、培养、呵护、调整自己的心智的力量更重要的事情了.........

  • 相关阅读:
    ecshop与jquery冲突的解决方案
    ecshop_dwt_lbi模板添加
    ecshop模板基础知识
    bcc-tools工具之pidpersec
    bcc-tools工具之runqlen
    bcc-tools工具之runqlat
    bcc-tools工具之funccount
    cgroup介绍之为什么需要了解cgroup
    bcc-tools工具之funcslower
    git patch制作相关简介
  • 原文地址:https://www.cnblogs.com/appleseed/p/1949051.html
Copyright © 2011-2022 走看看