Class/Object

io.scalajs.dom.html.phaser.physics

P2

Related Docs: object P2 | package physics

Permalink

class P2 extends Object

This is your main access to the P2 Physics World. From here you can create materials, listen for events and add bodies into the physics simulation.

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

Instance Constructors

  1. new P2(game: Phaser.Game, config: RawOptions = js.native)

    Permalink

    game

    Reference to the current game instance.

    config

    Physics configuration object passed in from the game constructor.

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. var allowSleep: Boolean

    Permalink

    TODO

  5. var angle: Double

    Permalink

    The angle of the Body in degrees from its original orientation.

    The angle of the Body in degrees from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement Body.angle = 450 is the same as Body.angle = 90. If you wish to work in radians instead of degrees use the property Body.rotation instead. Working in radians is faster as it doesn't have to convert values. The angle of this Body in degrees.

  6. var angularDamping: Double

    Permalink

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second.

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second. The angular damping acting acting on the body.

  7. var angularForce: Double

    Permalink

    The angular force acting on the body.

  8. var angularVelocity: Double

    Permalink

    The angular velocity of the body.

  9. var applyDamping: Boolean

    Permalink

    Enable to automatically apply body damping each step.

  10. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. var collidesWith: Array[_]

    Permalink

    A Body can be set to collide against the World bounds automatically if this is set to true.

    A Body can be set to collide against the World bounds automatically if this is set to true. Otherwise it will leave the World. Note that this only applies if your World has bounds! The response to the collision should be managed via CollisionMaterials. Also note that when you set this it will only effect Body shapes that already exist. If you then add further shapes to your Body after setting this it will not proactively set them to collide with the bounds. Should the Body collide with the World bounds?

  13. val config: RawOptions

    Permalink

    Physics configuration object passed in from the game constructor.

  14. var damping: Double

    Permalink

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second.

    Damping is specified as a value between 0 and 1, which is the proportion of velocity lost per second. The linear damping acting on the body in the velocity direction.

  15. var data: Body

    Permalink

    The p2 Body data.

    The p2 Body data. Internal: This member is internal (protected) and may be modified or removed in the future.

  16. var debug: Boolean

    Permalink

    Enable or disable debug drawing of this body

  17. var debugBody: BodyDebug

    Permalink

    Reference to the debug body.

  18. var dirty: Boolean

    Permalink

    Internally used by Sprite.x/y

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

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

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

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

    Permalink

    Reference to the current game instance.

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

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

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

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

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

    Permalink
    Definition Classes
    Object
  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 propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  32. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

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

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