Class/Object

io.scalajs.dom.html.phaser

Timer

Related Docs: object Timer | package phaser

Permalink

class Timer extends Object

A Timer is a way to create and manage timer events that wait for a specific duration and then run a callback. Many different timer events, with individual delays, can be added to the same Timer.

All Timer delays are in milliseconds (there are 1000 ms in 1 second); so a delay value of 250 represents a quarter of a second.

Timers are based on real life time, adjusted for game pause durations. That is, timer events are based on elapsed game time and do not take physics time or slow motion into account.

Annotations
@RawJSType() @native() @JSName( "Phaser.Timer" )
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Timer
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Timer(game: Phaser.Game, autoDestroy: Boolean = js.native)

    Permalink

    game

    A reference to the currently running game.

    autoDestroy

    If true, the timer will automatically destroy itself after all the events have been dispatched (assuming no looping events).

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. val autoDestroy: Boolean

    Permalink

    If true, the timer will automatically destroy itself after all the events have been dispatched (assuming no looping events).

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def duration: Double

    Permalink

    The duration in ms remaining until the next event will occur.

  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def events: Array[Phaser.TimerEvent]

    Permalink

    An array holding all of this timers Phaser.TimerEvent objects.

    An array holding all of this timers Phaser.TimerEvent objects. Use the methods add, repeat and loop to populate it.

  11. def expired: Boolean

    Permalink

    An expired Timer is one in which all of its events have been dispatched and none are pending.

  12. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. var game: Phaser.Game

    Permalink

    A reference to the currently running game.

  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  19. def length: Int

    Permalink

    The number of pending events in the queue.

  20. def ms: Double

    Permalink

    The duration in milliseconds that this Timer has been running for.

  21. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  22. def next: Double

    Permalink

    The time at which the next event will occur.

  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. def onComplete: Phaser.Signal

    Permalink

    This signal will be dispatched when this Timer has completed which means that there are no more events in the queue.

    This signal will be dispatched when this Timer has completed which means that there are no more events in the queue.

    The signal is supplied with one argument, timer, which is this Timer object.

  26. def paused: Boolean

    Permalink

    The paused state of the Timer.

    The paused state of the Timer. You can pause the timer by calling Timer.pause() and Timer.resume() or by the game pausing.

  27. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  28. def running: Boolean

    Permalink

    True if the Timer is actively running.

    True if the Timer is actively running.

    Do not modify this boolean - use pause (and resume) to pause the timer.

  29. def seconds: Double

    Permalink

    The duration in seconds that this Timer has been running for.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def timeCap: Double

    Permalink

    If the difference in time between two frame updates exceeds this value, the event times are reset to avoid catch-up situations.

  32. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  33. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  34. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  35. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped