avg-core-ts
Version:
Develop Adventure Game (or ADV, Visual Novel, Galgame, etc.) on your own!
30 lines (24 loc) • 592 B
JavaScript
/**
* @file Container that provides transition functions
* @author MicroMatrix <yangpan.1985@bytedance.com>
* @copyright 2012-2020 bytedance
* @link git@code.byted.org:yangpan.1985/avg.git
*/
const PIXI = require('pixi.js');
const settings = PIXI.settings;
/**
* Shared Timer
*
* @export
* @class Ticker
* @extends {PIXI.ticker.Ticker}
*/
export default class Ticker extends PIXI.ticker.Ticker {
constructor(...args) {
super(...args);
this.elapsedTime = 0;
this.add(dt => {
this.elapsedTime += dt / settings.TARGET_FPMS;
});
}
}