Class

io.scalajs.dom.html.phaser

Time

Related Doc: package phaser

Permalink

class Time extends Object

This is the core internal game clock.

It manages the elapsed time and calculation of elapsed values, used for game object motion and tweens, and also handles the standard Timer pool.

To create a general timed event, use the master Phaser.Timer accessible through events.

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

Instance Constructors

  1. new Time(game: Phaser.Game)

    Permalink

    game

    A reference to the currently running game.

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. def add(timer: Phaser.Timer): Phaser.Timer

    Permalink

    Adds an existing Phaser.Timer object to the Timer pool.

    Adds an existing Phaser.Timer object to the Timer pool.

    timer

    An existing Phaser.Timer object.

    returns

    The given Phaser.Timer object.

  5. var advancedTiming: Boolean

    Permalink

    If true then advanced profiling, including the fps rate, fps min/max, suggestedFps and msMin/msMax are updated.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def create(autoDestroy: Boolean = js.native): Phaser.Timer

    Permalink

    Creates a new stand-alone Phaser.Timer object.

    Creates a new stand-alone Phaser.Timer object.

    autoDestroy

    A Timer that is set to automatically destroy itself will do so after all of its events have been dispatched (assuming no looping events).

    returns

    The Timer object that was created.

  9. var desiredFps: Int

    Permalink

    The desired frame rate of the game.

    The desired frame rate of the game.

    This is used is used to calculate the physic / logic multiplier and how to apply catch-up logic updates. The desired frame rate of the game. Defaults to 60.

  10. def elapsedSecondsSince(since: Double): Double

    Permalink

    How long has passed since the given time (in seconds).

    How long has passed since the given time (in seconds).

    since

    The time you want to measure (in seconds).

    returns

    Duration between given time and now (in seconds).

  11. def elapsedSince(since: Double): Double

    Permalink

    How long has passed since the given time.

    How long has passed since the given time.

    since

    The time you want to measure against.

    returns

    The difference between the given time and now.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  14. def events: Phaser.Timer

    Permalink

    A Phaser.Timer object bound to the master clock (this Time object) which events can be added to.

  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def fps: Double

    Permalink

    Advanced timing result: Frames per second.

    Advanced timing result: Frames per second.

    Only calculated if advancedTiming is enabled.

  17. def fpsMax: Double

    Permalink

    Advanced timing result: The highest rate the fps has reached (usually no higher than 60fps).

    Advanced timing result: The highest rate the fps has reached (usually no higher than 60fps).

    Only calculated if advancedTiming is enabled. This value can be manually reset.

  18. var fpsMin: Double

    Permalink

    Advanced timing result: The lowest rate the fps has dropped to.

    Advanced timing result: The lowest rate the fps has dropped to.

    Only calculated if advancedTiming is enabled. This value can be manually reset.

  19. def frames: Int

    Permalink

    Advanced timing result: The number of render frames record in the last second.

    Advanced timing result: The number of render frames record in the last second.

    Only calculated if advancedTiming is enabled.

  20. var game: Phaser.Game

    Permalink

    A reference to the currently running game.

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

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

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

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

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

    Permalink
    Definition Classes
    Object
  26. def msMax: Double

    Permalink

    Advanced timing result: The maximum amount of time the game has taken between consecutive frames.

    Advanced timing result: The maximum amount of time the game has taken between consecutive frames.

    Only calculated if advancedTiming is enabled. This value can be manually reset.

  27. def msMin: Double

    Permalink

    Advanced timing result: The minimum amount of time the game has taken between consecutive frames.

    Advanced timing result: The minimum amount of time the game has taken between consecutive frames.

    Only calculated if advancedTiming is enabled. This value can be manually reset.

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

    Permalink
    Definition Classes
    AnyRef
  29. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  31. def now: Double

    Permalink

    An increasing value representing cumulative milliseconds since an undisclosed epoch.

    An increasing value representing cumulative milliseconds since an undisclosed epoch.

    While this value is in milliseconds and can be used to compute time deltas, it must must not be used with Date.now() as it may not use the same epoch / starting reference.

    The source may either be from a high-res source (eg. if RAF is available) or the standard Date.now; the value can only be relied upon within a particular game instance.

  32. def pauseDuration: Double

    Permalink

    Records how long the game was last paused, in milliseconds.

    Records how long the game was last paused, in milliseconds. (This is not updated until the game is resumed.)

  33. def physicsElapsed: Double

    Permalink

    The physics update delta, in fractional seconds.

    The physics update delta, in fractional seconds.

    This should be used as an applicable multiplier by all logic update steps (eg. preUpdate/postUpdate/update) to ensure consistent game timing. Game/logic timing can drift from real-world time if the system is unable to consistently maintain the desired FPS.

    With fixed-step updates this is normally equivalent to 1.0 / desiredFps.

  34. def physicsElapsedMS: Double

    Permalink

    The physics update delta, in milliseconds - equivalent to physicsElapsed * 1000.

  35. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  36. def refresh(): Unit

    Permalink

    Refreshes the Time.time and Time.elapsedMS properties from the system clock.

  37. def removeAll(): Unit

    Permalink

    Remove all Timer objects, regardless of their state and clears all Timers from the events timer.

  38. def reset(): Unit

    Permalink

    Resets the private _started value to now and removes all currently running Timers.

  39. def slowMotion: Double

    Permalink

    Scaling factor to make the game move smoothly in slow motion

    Scaling factor to make the game move smoothly in slow motion

    • 1.0 = normal speed
    • 2.0 = half speed
  40. def suggestedFps: Double

    Permalink

    The suggested frame rate for your game, based on an averaged real frame rate.

    The suggested frame rate for your game, based on an averaged real frame rate. This value is only populated if Time.advancedTiming is enabled.

    Note: This is not available until after a few frames have passed; until then it's set to the same value as desiredFps.

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

    Permalink
    Definition Classes
    AnyRef
  42. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  44. def totalElapsedSeconds(): Double

    Permalink

    The number of seconds that have elapsed since the game was started.

  45. def valueOf(): Any

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. 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