new ImpactBody(world, x, y, width, height)
Parameters:
Name | Type | Description |
---|---|---|
world |
Phaser.Physics.Impact.World | [description] |
x |
number | x - The horizontal position of this physics body in the world. |
y |
number | y - The vertical position of this physics body in the world. |
width |
number | The width of the physics body in the world. |
height |
number | [description] |
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 10)
Extends
- Phaser.Physics.Impact.Components.Acceleration
- Phaser.Physics.Impact.Components.BodyScale
- Phaser.Physics.Impact.Components.BodyType
- Phaser.Physics.Impact.Components.Bounce
- Phaser.Physics.Impact.Components.CheckAgainst
- Phaser.Physics.Impact.Components.Collides
- Phaser.Physics.Impact.Components.Debug
- Phaser.Physics.Impact.Components.Friction
- Phaser.Physics.Impact.Components.Gravity
- Phaser.Physics.Impact.Components.Offset
- Phaser.Physics.Impact.Components.SetGameObject
- Phaser.Physics.Impact.Components.Velocity
Members
-
accel :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 97)
-
body :Phaser.Physics.Impact.Body
-
[description]
Type:
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 59)
-
bounce :number
-
The bounce, or restitution, value of this body. A value between 0 (no rebound) and 1 (full rebound)
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Bounce.js (Line 50)
-
checkAgainst :number
-
[description]
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 93)
-
collides :number
-
[description]
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 127)
-
debugBodyColor :number
-
[description]
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Debug.js (Line 96)
-
debugShowBody :boolean
-
[description]
Type:
- boolean
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Debug.js (Line 54)
-
debugShowVelocity :boolean
-
[description]
Type:
- boolean
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Debug.js (Line 75)
-
friction :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 106)
-
gravity :number
-
[description]
Type:
- number
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Gravity.js (Line 33)
-
maxVel :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 115)
-
offset :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 79)
-
size :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 70)
-
vel :Object
-
[description]
Type:
- Object
- Since: 3.0.0
- Source: src/physics/impact/ImpactBody.js (Line 88)
Methods
-
getBodyType()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyType.js (Line 18)
Returns:
[description]
- Type
- number
-
setAcceleration(x, y)
-
Sets the horizontal and vertical acceleration of this body.
Parameters:
Name Type Description x
number The amount of horizontal acceleration to apply.
y
number The amount of vertical acceleration to apply.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Acceleration.js (Line 50)
Returns:
This Game Object.
-
setAccelerationX(x)
-
Sets the horizontal acceleration of this body.
Parameters:
Name Type Description x
number The amount of acceleration to apply.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Acceleration.js (Line 16)
Returns:
This Game Object.
-
setAccelerationY(y)
-
Sets the vertical acceleration of this body.
Parameters:
Name Type Description y
number The amount of acceleration to apply.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Acceleration.js (Line 33)
Returns:
This Game Object.
-
setActiveCollision()
-
[description]
- Since: 3.6.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 97)
Returns:
This Game Object.
-
setAvsB()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 18)
Returns:
This Game Object.
-
setBodyScale(scaleX [, scaleY])
-
Sets the scale of the physics body.
Parameters:
Name Type Argument Description scaleX
number The horizontal scale of the body.
scaleY
number <optional>
The vertical scale of the body. If not given, will use the horizontal scale value.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyScale.js (Line 37)
Returns:
This Game Object.
-
setBodySize(width [, height])
-
Sets the size of the physics body.
Parameters:
Name Type Argument Default Description width
number The width of the body in pixels.
height
number <optional>
width The height of the body in pixels.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyScale.js (Line 16)
Returns:
This Game Object.
-
setBounce(value)
-
Sets the impact physics bounce, or restitution, value.
Parameters:
Name Type Description value
number A value between 0 (no rebound) and 1 (full rebound)
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Bounce.js (Line 16)
Returns:
This Game Object.
-
setBvsA()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 33)
Returns:
This Game Object.
-
setCheckAgainstA()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 63)
Returns:
This Game Object.
-
setCheckAgainstB()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 78)
Returns:
This Game Object.
-
setCheckAgainstNone()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/CheckAgainst.js (Line 48)
Returns:
This Game Object.
-
setCollideCallback(callback, scope)
-
[description]
Parameters:
Name Type Description callback
CollideCallback [description]
scope
* [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 29)
Returns:
This Game Object.
-
setCollidesNever()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 52)
Returns:
This Game Object.
-
setDebug(showBody, showVelocity, bodyColor)
-
[description]
Parameters:
Name Type Description showBody
boolean [description]
showVelocity
boolean [description]
bodyColor
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Debug.js (Line 16)
Returns:
This Game Object.
-
setDebugBodyColor(value)
-
[description]
Parameters:
Name Type Description value
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Debug.js (Line 37)
Returns:
This Game Object.
-
setFixedCollision()
-
[description]
- Since: 3.6.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 112)
Returns:
This Game Object.
-
setFriction(x, y)
-
[description]
Parameters:
Name Type Description x
number [description]
y
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Friction.js (Line 50)
Returns:
This Game Object.
-
setFrictionX(x)
-
[description]
Parameters:
Name Type Description x
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Friction.js (Line 16)
Returns:
This Game Object.
-
setFrictionY(y)
-
[description]
Parameters:
Name Type Description y
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Friction.js (Line 33)
Returns:
This Game Object.
-
setGameObject(gameObject [, sync])
-
[description]
Parameters:
Name Type Argument Default Description gameObject
Phaser.GameObjects.GameObject [description]
sync
boolean <optional>
true [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/SetGameObject.js (Line 16)
Returns:
This Game Object.
-
setGravity(value)
-
[description]
Parameters:
Name Type Description value
number [description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Gravity.js (Line 16)
Returns:
This Game Object.
-
setLiteCollision()
-
[description]
- Since: 3.6.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 67)
Returns:
This Game Object.
-
setMaxVelocity(x [, y])
-
Sets the maximum velocity this body can travel at.
Parameters:
Name Type Argument Default Description x
number The maximum allowed horizontal velocity.
y
number <optional>
x The maximum allowed vertical velocity. If not given, defaults to the horizontal value.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Velocity.js (Line 71)
Returns:
This Game Object.
-
setMinBounceVelocity(value)
-
Sets the minimum velocity the body is allowed to be moving to be considered for rebound.
Parameters:
Name Type Description value
number The minimum allowed velocity.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Bounce.js (Line 33)
Returns:
This Game Object.
-
setOffset(x, y [, width] [, height])
-
[description]
Parameters:
Name Type Argument Description x
number [description]
y
number [description]
width
number <optional>
[description]
height
number <optional>
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Offset.js (Line 16)
Returns:
This Game Object.
-
setPassiveCollision()
-
[description]
- Since: 3.6.0
- Inherited From:
- Source: src/physics/impact/components/Collides.js (Line 82)
Returns:
This Game Object.
-
setTypeA()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyType.js (Line 46)
Returns:
This Game Object.
-
setTypeB()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyType.js (Line 61)
Returns:
This Game Object.
-
setTypeNone()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/BodyType.js (Line 31)
Returns:
This Game Object.
-
setVelocity(x [, y])
-
Sets the horizontal and vertical velocities of the physics body.
Parameters:
Name Type Argument Default Description x
number The horizontal velocity value.
y
number <optional>
x The vertical velocity value. If not given, defaults to the horizontal value.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Velocity.js (Line 50)
Returns:
This Game Object.
-
setVelocityX(x)
-
Sets the horizontal velocity of the physics body.
Parameters:
Name Type Description x
number The horizontal velocity value.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Velocity.js (Line 16)
Returns:
This Game Object.
-
setVelocityY(y)
-
Sets the vertical velocity of the physics body.
Parameters:
Name Type Description y
number The vertical velocity value.
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/Velocity.js (Line 33)
Returns:
This Game Object.
-
syncGameObject()
-
[description]
- Since: 3.0.0
- Inherited From:
- Source: src/physics/impact/components/SetGameObject.js (Line 48)
Returns:
This Game Object.