liajoy Posted January 11, 2019 Share Posted January 11, 2019 app.ticker.add(function(delta) { console.log(delta); // first log will be 5 or 6 // then 1.xxxx }) Hello! How to prevent this? is this a bug or a feature? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 11, 2019 Share Posted January 11, 2019 There's no "previous" time for first tick, this is undefined behaviour for pixi. If you want to change it, please make a Pull Request or at least an Issue, its such a small thing that I dont even want to do it myself. Here's file in v5 branch (dev): https://github.com/pixijs/pixi.js/blob/dev/packages/ticker/src/Ticker.js Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 11, 2019 Share Posted January 11, 2019 https://github.com/pixijs/pixi.js/blob/dev/packages/ticker/src/Ticker.js#L395 "this.lastTime" is "-1" for first tick. Considering that most people use some asynchronous loader before game actually starts, first tick is not important. Quote Link to comment Share on other sites More sharing options...
Exca Posted January 11, 2019 Share Posted January 11, 2019 You could also ignore the few first ticks to let the ticker settle down (gpu uploads etc. might be happening at that point which takes some time). ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 11, 2019 Share Posted January 11, 2019 Yeah, related thread: this thing also affects ticker, and that's not first tick, that's on game start. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.