Phaser API Documentation

  Version: 
Filter
Namespace: Arcade
Phaser.Types.Physics.Arcade

Type Definitions

ArcadeBodyBounds
Focus
Focus
Properties:
name type description
x number

The left edge.

y number

The upper edge.

right number

The right edge.

bottom number

The lower edge.

Type:
object
Focus
Focus
ArcadeBodyCollision
Focus
Focus
Properties:
name type description
none boolean

True if the Body is not colliding.

up boolean

True if the Body is colliding on its upper edge.

down boolean

True if the Body is colliding on its lower edge.

left boolean

True if the Body is colliding on its left edge.

right boolean

True if the Body is colliding on its right edge.

Type:
object
Focus
Focus
ArcadePhysicsCallback(object1, object2)
Focus
Focus

Parameters:

name type description
object1 Phaser.Tilemaps.Tile | Phaser.Types.Physics.Arcade.GameObjectWithBody

The first Game Object.

object2 Phaser.Tilemaps.Tile | Phaser.Types.Physics.Arcade.GameObjectWithBody

The second Game Object.

Type:
function
Focus
Focus
ArcadeWorldConfig
Focus
Focus
Properties:
name type arguments Default description
fps number <optional> 60

Sets Phaser.Physics.Arcade.World#fps.

fixedStep boolean <optional> true

Sets Phaser.Physics.Arcade.World#fixedStep.

timeScale number <optional> 1

Sets Phaser.Physics.Arcade.World#timeScale.

gravity Phaser.Types.Math.Vector2Like <optional>

Sets Phaser.Physics.Arcade.World#gravity.

x number <optional> 0

Sets bounds.x.

y number <optional> 0

Sets bounds.y.

width number <optional> 0

Sets bounds.width.

height number <optional> 0

Sets bounds.height.

checkCollision Phaser.Types.Physics.Arcade.CheckCollisionObject <optional>

Sets Phaser.Physics.Arcade.World#checkCollision.

overlapBias number <optional> 4

Sets Phaser.Physics.Arcade.World#OVERLAP_BIAS.

tileBias number <optional> 16

Sets Phaser.Physics.Arcade.World#TILE_BIAS.

forceX boolean <optional> false

Sets Phaser.Physics.Arcade.World#forceX.

isPaused boolean <optional> false

Sets Phaser.Physics.Arcade.World#isPaused.

debug boolean <optional> false

Sets Phaser.Physics.Arcade.World#debug.

debugShowBody boolean <optional> true

Sets debugShowBody.

debugShowStaticBody boolean <optional> true

Sets debugShowStaticBody.

debugShowVelocity boolean <optional> true

Sets debugShowStaticBody.

debugBodyColor number <optional> 0xff00ff

Sets bodyDebugColor.

debugStaticBodyColor number <optional> 0x0000ff

Sets staticBodyDebugColor.

debugVelocityColor number <optional> 0x00ff00

Sets velocityDebugColor.

maxEntries number <optional> 16

Sets Phaser.Physics.Arcade.World#maxEntries.

useTree boolean <optional> true

Sets Phaser.Physics.Arcade.World#useTree.

customUpdate boolean <optional> false

If enabled, you need to call World.update yourself.

Type:
object
Focus
Focus
ArcadeWorldDefaults
Focus
Focus
Properties:
name type description
debugShowBody boolean

Set to true to render dynamic body outlines to the debug display.

debugShowStaticBody boolean

Set to true to render static body outlines to the debug display.

debugShowVelocity boolean

Set to true to render body velocity markers to the debug display.

bodyDebugColor number

The color of dynamic body outlines when rendered to the debug display.

staticBodyDebugColor number

The color of static body outlines when rendered to the debug display.

velocityDebugColor number

The color of the velocity markers when rendered to the debug display.

Type:
object
Focus
Focus
ArcadeWorldTreeMinMax
Focus
Focus
Properties:
name type description
minX number

The minimum x value used in RTree searches.

minY number

The minimum y value used in RTree searches.

maxX number

The maximum x value used in RTree searches.

maxY number

The maximum y value used in RTree searches.

Type:
object
Focus
Focus
CheckCollisionObject
Focus
Focus
Properties:
name type description
up boolean

Will bodies collide with the top side of the world bounds?

down boolean

Will bodies collide with the bottom side of the world bounds?

left boolean

Will bodies collide with the left side of the world bounds?

right boolean

Will bodies collide with the right side of the world bounds?

Type:
object
Focus
Focus
GameObjectWithBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
GameObjectWithDynamicBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
GameObjectWithStaticBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
ImageWithDynamicBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
ImageWithStaticBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
PhysicsGroupConfig
Focus
Focus
Properties:
name type arguments Default description
collideWorldBounds boolean <optional> false

Sets Phaser.Physics.Arcade.Body#collideWorldBounds.

customBoundsRectangle Phaser.Geom.Rectangle <optional> null

Sets setBoundsRectangle.

accelerationX number <optional> 0

Sets acceleration.x.

accelerationY number <optional> 0

Sets acceleration.y.

allowDrag boolean <optional> true

Sets Phaser.Physics.Arcade.Body#allowDrag.

allowGravity boolean <optional> true

Sets Phaser.Physics.Arcade.Body#allowGravity.

allowRotation boolean <optional> true

Sets Phaser.Physics.Arcade.Body#allowRotation.

useDamping boolean <optional> false

Sets useDamping.

bounceX number <optional> 0

Sets bounce.x.

bounceY number <optional> 0

Sets bounce.y.

dragX number <optional> 0

Sets drag.x.

dragY number <optional> 0

Sets drag.y.

enable boolean <optional> true

Sets enable.

gravityX number <optional> 0

Sets gravity.x.

gravityY number <optional> 0

Sets gravity.y.

frictionX number <optional> 0

Sets friction.x.

frictionY number <optional> 0

Sets friction.y.

maxSpeed number <optional> -1

Sets maxSpeed.

maxVelocityX number <optional> 10000

Sets maxVelocity.x.

maxVelocityY number <optional> 10000

Sets maxVelocity.y.

velocityX number <optional> 0

Sets velocity.x.

velocityY number <optional> 0

Sets velocity.y.

angularVelocity number <optional> 0

Sets Phaser.Physics.Arcade.Body#angularVelocity.

angularAcceleration number <optional> 0

Sets Phaser.Physics.Arcade.Body#angularAcceleration.

angularDrag number <optional> 0

Sets Phaser.Physics.Arcade.Body#angularDrag.

mass number <optional> 0

Sets Phaser.Physics.Arcade.Body#mass.

immovable boolean <optional> false

Sets Phaser.Physics.Arcade.Body#immovable.

Type:
object
Focus
Focus
PhysicsGroupDefaults
Focus
Focus
Properties:
name type description
setCollideWorldBounds boolean

As Phaser.Physics.Arcade.Body#setCollideWorldBounds.

setBoundsRectangle Phaser.Geom.Rectangle

As Phaser.Physics.Arcade.Body#setBoundsRectangle.

setAccelerationX number

As Phaser.Physics.Arcade.Body#setAccelerationX.

setAccelerationY number

As Phaser.Physics.Arcade.Body#setAccelerationY.

setAllowDrag boolean

As Phaser.Physics.Arcade.Body#setAllowDrag.

setAllowGravity boolean

As Phaser.Physics.Arcade.Body#setAllowGravity.

setAllowRotation boolean

As Phaser.Physics.Arcade.Body#setAllowRotation.

setDamping boolean

As Phaser.Physics.Arcade.Body#setDamping.

setBounceX number

As Phaser.Physics.Arcade.Body#setBounceX.

setBounceY number

As Phaser.Physics.Arcade.Body#setBounceY.

setDragX number

As Phaser.Physics.Arcade.Body#setDragX.

setDragY number

As Phaser.Physics.Arcade.Body#setDragY.

setEnable boolean

As Phaser.Physics.Arcade.Body#setEnable.

setGravityX number

As Phaser.Physics.Arcade.Body#setGravityX.

setGravityY number

As Phaser.Physics.Arcade.Body#setGravityY.

setFrictionX number

As Phaser.Physics.Arcade.Body#setFrictionX.

setFrictionY number

As Phaser.Physics.Arcade.Body#setFrictionY.

setMaxSpeed number

As Phaser.Physics.Arcade.Body#setMaxSpeed.

setVelocityX number

As Phaser.Physics.Arcade.Body#setVelocityX.

setVelocityY number

As Phaser.Physics.Arcade.Body#setVelocityY.

setAngularVelocity number

As Phaser.Physics.Arcade.Body#setAngularVelocity.

setAngularAcceleration number

As Phaser.Physics.Arcade.Body#setAngularAcceleration.

setAngularDrag number

As Phaser.Physics.Arcade.Body#setAngularDrag.

setMass number

As Phaser.Physics.Arcade.Body#setMass.

setImmovable boolean

As Phaser.Physics.Arcade.Body#setImmovable.

Type:
object
Focus
Focus
SpriteWithDynamicBody
Focus
Focus
Properties:
Type:
object
Focus
Focus
SpriteWithStaticBody
Focus
Focus
Properties:
Type:
object
Focus
Focus