addFrameCallback
Posted: Thu Jul 02, 2020 12:45 pm
How would I use addFrameCallback to speed up animation
I have:
this.shipWillLaunchFromStation = function()
{
if (this._radarTimer)
this._radarTimer.start()
else
this._radarTimer = new Timer(this, this._radarCheck, 0.25, 0.25)
this.$radar = 0;
}
this._radarCheck = function()
{
this.$radar += 1;
if(this.$radar == 25) {this.$radar = 0}
this.$Hudchart = ("P" + this.$radar + ".png");
player.ship.setCustomHUDDial("fhud1", this.$Hudchart);
}
but the animation is not smooth; I believe addFrameCallback would be better but cannot get the code to work - any suggestions?
I have:
this.shipWillLaunchFromStation = function()
{
if (this._radarTimer)
this._radarTimer.start()
else
this._radarTimer = new Timer(this, this._radarCheck, 0.25, 0.25)
this.$radar = 0;
}
this._radarCheck = function()
{
this.$radar += 1;
if(this.$radar == 25) {this.$radar = 0}
this.$Hudchart = ("P" + this.$radar + ".png");
player.ship.setCustomHUDDial("fhud1", this.$Hudchart);
}
but the animation is not smooth; I believe addFrameCallback would be better but cannot get the code to work - any suggestions?