Timer.js 860 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. function Timer() {
  2. }
  3. Duktape.fin(Timer.prototype, function (x) {
  4. if (x === Timer.prototype) {
  5. return;
  6. }
  7. Polycode.Timer__delete(x.__ptr)
  8. })
  9. Timer.prototype.Pause = function(paused) {
  10. Polycode.Timer_Pause(this.__ptr, paused)
  11. }
  12. Timer.prototype.isPaused = function() {
  13. return Polycode.Timer_isPaused(this.__ptr)
  14. }
  15. Timer.prototype.getTicks = function() {
  16. return Polycode.Timer_getTicks(this.__ptr)
  17. }
  18. Timer.prototype.Update = function(ticks) {
  19. Polycode.Timer_Update(this.__ptr, ticks)
  20. }
  21. Timer.prototype.Reset = function() {
  22. Polycode.Timer_Reset(this.__ptr)
  23. }
  24. Timer.prototype.hasElapsed = function() {
  25. return Polycode.Timer_hasElapsed(this.__ptr)
  26. }
  27. Timer.prototype.getElapsedf = function() {
  28. return Polycode.Timer_getElapsedf(this.__ptr)
  29. }
  30. Timer.prototype.setTimerInterval = function(msecs) {
  31. Polycode.Timer_setTimerInterval(this.__ptr, msecs)
  32. }