feat: added added new skin to ptilopsis
well, i have to make changes to spine-ts so it can handle the difference between the size of texture
This commit is contained in:
@@ -349,29 +349,35 @@ module spine {
|
||||
}
|
||||
|
||||
export class TimeKeeper {
|
||||
maxDelta = 0.064;
|
||||
framesPerSecond = 0;
|
||||
delta = 0;
|
||||
totalTime = 0;
|
||||
framesPerSecond = 0
|
||||
delta = 0
|
||||
totalTime = 0
|
||||
|
||||
private lastTime = Date.now() / 1000;
|
||||
private frameCount = 0;
|
||||
private frameTime = 0;
|
||||
private lastTime = performance.now() / 1000
|
||||
private frameCount = 0
|
||||
private frameTime = 0
|
||||
private fpsInterval = 1 / 60
|
||||
|
||||
update () {
|
||||
let now = Date.now() / 1000;
|
||||
this.delta = now - this.lastTime;
|
||||
this.frameTime += this.delta;
|
||||
this.totalTime += this.delta;
|
||||
if (this.delta > this.maxDelta) this.delta = this.maxDelta;
|
||||
this.lastTime = now;
|
||||
update() {
|
||||
const now = performance.now() / 1000
|
||||
this.delta = now - this.lastTime
|
||||
if (this.delta > this.fpsInterval) {
|
||||
this.frameTime += this.delta
|
||||
this.totalTime += this.delta
|
||||
this.lastTime = now
|
||||
|
||||
this.frameCount++;
|
||||
if (this.frameTime > 1) {
|
||||
this.framesPerSecond = this.frameCount / this.frameTime;
|
||||
this.frameTime = 0;
|
||||
this.frameCount = 0;
|
||||
}
|
||||
this.frameCount++
|
||||
if (this.frameTime > 1) {
|
||||
this.framesPerSecond = this.frameCount / this.frameTime
|
||||
this.frameTime = 0
|
||||
this.frameCount = 0
|
||||
}
|
||||
} else {
|
||||
this.delta = -1
|
||||
}
|
||||
}
|
||||
setFps(v: number) {
|
||||
this.fpsInterval = 1 / v
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user