Difference between revisions of "Oolite JavaScript Reference: Frame Callbacks"

From Elite Wiki
(Page created)
 
(Added a little more)
 
Line 5: Line 5:
  
 
Frame callbacks can be used for a number of purposes including animations
 
Frame callbacks can be used for a number of purposes including animations
 +
 +
"shift-F" - Displays frame rate, object- and collision-counter and player's pwm-coordinates. (Only available in [https://oolite.space/#download "Developer Release"] versions of Oolite.)
 +
  
 
== Links ==
 
== Links ==
Line 10: Line 13:
 
*[https://bb.oolite.space/viewtopic.php?t=8941 Jens Ayton explaining frame callbacks] (2011)
 
*[https://bb.oolite.space/viewtopic.php?t=8941 Jens Ayton explaining frame callbacks] (2011)
 
*[[Animated Ships]] - Thargoid's animation OXP demo (at the bottom of the page) contrasts two flapping butterflies, one animated using Frame Callbacks, the other using Timers.
 
*[[Animated Ships]] - Thargoid's animation OXP demo (at the bottom of the page) contrasts two flapping butterflies, one animated using Frame Callbacks, the other using Timers.
 +
*[[Javascript optimization tips]] - see Frame rate for details of measurement.
  
 
[[Category:Oolite JavaScript Reference]]
 
[[Category:Oolite JavaScript Reference]]

Latest revision as of 12:27, 31 July 2024

Frame callbacks are user-defined JavaScript functions that run on every single game "frame update".

Overview

These are faster than timers, which only fire 4 times a second. See Oolite JavaScript Reference: Timer for more on those.

Frame callbacks can be used for a number of purposes including animations

"shift-F" - Displays frame rate, object- and collision-counter and player's pwm-coordinates. (Only available in "Developer Release" versions of Oolite.)


Links