アニメーションを管理してるクラスの内部処理を想定してます
var delay = 0;/*処理中に適度にdelayに値が代入される*/
var self = this;
self.timeId = setTimeout(function(){
clearTimeout(self.timeId);
//処理中略
},1000/self.fps + delay);
とclearTimeoutをしないとdelayがうまく動いてくれません。。
More than 5 years have passed since last update.
アニメーションを管理してるクラスの内部処理を想定してます
var delay = 0;/*処理中に適度にdelayに値が代入される*/
var self = this;
self.timeId = setTimeout(function(){
clearTimeout(self.timeId);
//処理中略
},1000/self.fps + delay);
とclearTimeoutをしないとdelayがうまく動いてくれません。。
Register as a new user and use Qiita more conveniently