Class

io.scalajs.dom.html.phaser

Game

Related Doc: package phaser

Permalink

class Game extends Object

This is where the magic happens. The Game object is the heart of your game, providing quick access to common functions and handling the boot process.

Annotations
@RawJSType() @native() @JSName( "Phaser.Game" )
See also

https://phaser.io/docs/2.6.2/Phaser.Game.html

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Game
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Game(width: |[JsNumber, String] = js.native, height: |[JsNumber, String] = js.native, renderer: Int = js.native, parent: |[String, HTMLElement] = js.native, state: State = js.native, transparent: Boolean = js.native, antialias: Boolean = js.native, physicsConfig: RawOptions = js.native)

    Permalink

    width

    The width of your game in game pixels. If given as a string the value must be between 0 and 100 and will be used as the percentage width of the parent container, or the browser window if no parent is given.

    height

    The height of your game in game pixels. If given as a string the value must be between 0 and 100 and will be used as the percentage height of the parent container, or the browser window if no parent is given.

    renderer

    Which renderer to use: Phaser.AUTO will auto-detect, Phaser.WEBGL, Phaser.CANVAS or Phaser.HEADLESS (no rendering at all).

    parent

    The DOM element into which this games canvas will be injected. Either a DOM ID (string) or the element itself.

    state

    The default state object. A object consisting of Phaser.State functions (preload, create, update, render) or null.

    transparent

    Use a transparent canvas background or not.

    antialias

    Draw all image textures anti-aliased or not. The default is for smooth textures, but disable if your game features pixel art.

    physicsConfig

    A physics configuration object to pass to the Physics world on creation.

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: GameObjectFactory

    Permalink

    Reference to the Phaser.GameObjectFactory.

  5. val antialias: Boolean

    Permalink

    Draw all image textures anti-aliased or not.

    Draw all image textures anti-aliased or not. The default is for smooth textures, but disable if your game features pixel art.

  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def cache: Cache

    Permalink

    Reference to the assets cache.

  8. def camera: Camera

    Permalink

    A handy reference to world.camera.

  9. var clearBeforeRender: Boolean

    Permalink

    Clear the Canvas each frame before rendering the display list.

    Clear the Canvas each frame before rendering the display list. You can set this to false to gain some performance if your game always contains a background that completely fills the display.

  10. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  11. def config: GameConfigObject

    Permalink

    The Phaser.Game configuration object.

  12. def context: CanvasRenderingContext2D

    Permalink

    A handy reference to renderer.context (only set for CANVAS games, not WebGL)

  13. def create: Create

    Permalink

    The Asset Generator.

  14. def debug: Debug

    Permalink

    A set of useful debug utilities.

  15. def device: Device

    Permalink

    Contains device information and capabilities.

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def forceSingleUpdate: Boolean

    Permalink

    Should the game loop force a logic update, regardless of the delta timer? Set to true if you know you need this.

    Should the game loop force a logic update, regardless of the delta timer? Set to true if you know you need this. You can toggle it on the fly.

  20. def fpsProblemNotifier: Signal

    Permalink

    If the game is struggling to maintain the desired FPS, this signal will be dispatched.

    If the game is struggling to maintain the desired FPS, this signal will be dispatched. The desired/chosen FPS should probably be closer to the Phaser.Time#suggestedFps value.

  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. val height: |[JsNumber, String]

    Permalink

    The height of your game in game pixels.

    The height of your game in game pixels. If given as a string the value must be between 0 and 100 and will be used as the percentage height of the parent container, or the browser window if no parent is given.

  25. def id: Int

    Permalink

    Phaser Game ID (for when Pixi supports multiple instances).

  26. def input: Input

    Permalink

    Reference to the input manager

  27. def isBooted: Boolean

    Permalink

    Whether the game engine is booted, aka available.

  28. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  30. def isRunning: Boolean

    Permalink

    Is game running or paused?

  31. def load: Loader

    Permalink

    Reference to the assets loader.

  32. def lockRender: Boolean

    Permalink

    If false Phaser will automatically render the display list every update.

    If false Phaser will automatically render the display list every update. If true the render loop will be skipped. You can toggle this value at run-time to gain exact control over when Phaser renders. This can be useful in certain types of game or application.

    Please note that if you don't render the display list then none of the game object transforms will be updated, so use this value carefully.

  33. def make: GameObjectCreator

    Permalink

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

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

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

    Permalink
    Definition Classes
    AnyRef
  37. val parent: |[String, HTMLElement]

    Permalink

    The DOM element into which this games canvas will be injected.

    The DOM element into which this games canvas will be injected. Either a DOM ID (string) or the element itself.

  38. def physics: Physics

    Permalink

  39. val physicsConfig: RawOptions

    Permalink

    A physics configuration object to pass to the Physics world on creation.

  40. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  41. val renderer: Int

    Permalink

    Which renderer to use: Phaser.AUTO will auto-detect, Phaser.WEBGL, Phaser.CANVAS or Phaser.HEADLESS (no rendering at all).

  42. def rnd: RandomDataGenerator

    Permalink
  43. val state: State

    Permalink

    The default state object.

    The default state object. A object consisting of Phaser.State functions (preload, create, update, render) or null.

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

    Permalink
    Definition Classes
    AnyRef
  45. def time: Time

    Permalink
  46. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  48. val transparent: Boolean

    Permalink

    Use a transparent canvas background or not.

  49. def valueOf(): Any

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  53. val width: |[JsNumber, String]

    Permalink

    The width of your game in game pixels.

    The width of your game in game pixels. If given as a string the value must be between 0 and 100 and will be used as the percentage width of the parent container, or the browser window if no parent is given.

  54. def world: World

    Permalink

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped