Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   FAQ (http://www.flasher.ru/forum/forumdisplay.php?f=86)
-   -   [Script] как узнать FPS (http://www.flasher.ru/forum/showthread.php?t=66052)

Nirth 25.06.2005 22:18

[Script] как узнать FPS
 
Код:

Object.prototype.getFps = function() {   
    if (signal == true) {
        time = getTimer();
    } else {
        tempo = int(1000 / (getTimer() - time));
    }
    signal = !signal;
    return tempo;
};

// Aufruf
this.onEnterFrame = function() {   
    txtAusgabe = getFps();
};

код написал - Madokan

Artem Brigert 27.06.2005 03:27

Мадокан или просто мой сосед Matthias Kannengiesser написал так :)
Код:

MovieClip.prototype.fpsmeter = function ()
{
    this.zaehler = 0;
    this.onEnterFrame = function ()
    {
        this.zaehler++;
    };
    anzeigen = function ()
    {
        trace(this.zaehler);       
        this.zaehler = 0;
    };
    setInterval (this, "anzeigen", 1000);
};
ASSetPropFlags (MovieClip.prototype, "fpsmeter", 1);




// ## Beispiel Aufruf: ##########

this.fpsmeter ();



Часовой пояс GMT +4, время: 01:25.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.