Image
An Arcade Physics Image is a standard Image Game Object with an Arcade Physics body and related physics components mixed in. It is the lightest-weight physics-enabled Game Object available in Arcade Physics, making it ideal for static scenery, collectibles, platforms, bullets, or any non-animated object that needs to participate in physics collisions and overlap checks.
The physics body can be either dynamic (affected by velocity, acceleration, and gravity) or static (immovable, used for platforms and boundaries). Physics behaviour is controlled via the mixed-in Arcade Physics components such as Velocity, Acceleration, Bounce, Gravity, and so on.
The key difference between an Arcade Image and an Arcade Sprite is that an Arcade Image cannot play texture-based animations. If you need frame animations, use Phaser.Physics.Arcade.Sprite instead. If you only need a static or programmatically-moved object without animations, the Arcade Image is the more efficient choice.
You should not normally create an ArcadeImage directly. Instead, use the factory method this.physics.add.image() from within a Scene, which creates the image and adds its body to the Arcade Physics world automatically.
Constructor
new Image(scene, x, y, texture, [frame])
Parameters
| name | type | optional | description |
|---|---|---|---|
| scene | Phaser.Scene | No | The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time. |
| x | number | No | The horizontal position of this Game Object in the world. |
| y | number | No | The vertical position of this Game Object in the world. |
| texture | string | Phaser.Textures.Texture | No | The key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager. |
| frame | string | number | Yes | An optional frame from the Texture this Game Object is rendering with. |
Scope: static
Extends
Phaser.GameObjects.Image
Phaser.Physics.Arcade.Components.Acceleration
Phaser.Physics.Arcade.Components.Angular
Phaser.Physics.Arcade.Components.Bounce
Phaser.Physics.Arcade.Components.Collision
Phaser.Physics.Arcade.Components.Debug
Phaser.Physics.Arcade.Components.Drag
Phaser.Physics.Arcade.Components.Enable
Phaser.Physics.Arcade.Components.Friction
Phaser.Physics.Arcade.Components.Gravity
Phaser.Physics.Arcade.Components.Immovable
Phaser.Physics.Arcade.Components.Mass
Phaser.Physics.Arcade.Components.Pushable
Phaser.Physics.Arcade.Components.Size
Phaser.Physics.Arcade.Components.Velocity
Phaser.GameObjects.Components.Alpha
Phaser.GameObjects.Components.BlendMode
Phaser.GameObjects.Components.Depth
Phaser.GameObjects.Components.Flip
Phaser.GameObjects.Components.GetBounds
Phaser.GameObjects.Components.Mask
Phaser.GameObjects.Components.Origin
Phaser.GameObjects.Components.ScrollFactor
Phaser.GameObjects.Components.Size
Phaser.GameObjects.Components.Texture
Phaser.GameObjects.Components.Tint
Phaser.GameObjects.Components.Transform
Phaser.GameObjects.Components.Visible
Source: src/physics/arcade/ArcadeImage.js#L11
Since: 3.0.0
Inherited Members
From Phaser.GameObjects.Components.Alpha:
From Phaser.GameObjects.Components.BlendMode:
From Phaser.GameObjects.Components.Depth:
From Phaser.GameObjects.Components.Filters:
- filterCamera
- filters
- filtersAutoFocus
- filtersFocusContext
- filtersForceComposite
- maxFilterSize
- renderFilters
From Phaser.GameObjects.Components.Flip:
From Phaser.GameObjects.Components.Lighting:
From Phaser.GameObjects.Components.Mask:
From Phaser.GameObjects.Components.Origin:
From Phaser.GameObjects.Components.RenderNodes:
From Phaser.GameObjects.Components.ScrollFactor:
From Phaser.GameObjects.Components.Size:
From Phaser.GameObjects.Components.TextureCrop:
From Phaser.GameObjects.Components.Tint:
From Phaser.GameObjects.Components.Transform:
From Phaser.GameObjects.Components.Visible:
From Phaser.GameObjects.GameObject:
- active
- cameraFilter
- data
- displayList
- ignoreDestroy
- input
- isDestroyed
- name
- parentContainer
- renderFlags
- scene
- state
- tabIndex
- type
- vertexRoundMode
From Phaser.Physics.Arcade.Components.Debug:
Public Members
body
body: Phaser.Physics.Arcade.Body, Phaser.Physics.Arcade.StaticBody
Description:
This Game Object's Physics Body.
Overrides: Phaser.GameObjects.Image#body
Source: src/physics/arcade/ArcadeImage.js#L98
Since: 3.0.0
Inherited Methods
From Phaser.Events.EventEmitter:
- addListener
- emit
- eventNames
- listenerCount
- listeners
- off
- on
- once
- removeAllListeners
- removeListener
- shutdown
From Phaser.GameObjects.Components.Alpha:
From Phaser.GameObjects.Components.BlendMode:
From Phaser.GameObjects.Components.Depth:
From Phaser.GameObjects.Components.Filters:
- enableFilters
- focusFilters
- focusFiltersOnCamera
- focusFiltersOverride
- renderWebGLFilters
- setFiltersAutoFocus
- setFiltersFocusContext
- setFiltersForceComposite
- setFilterSize
- setRenderFilters
- willRenderFilters
From Phaser.GameObjects.Components.Flip:
From Phaser.GameObjects.Components.GetBounds:
- getBottomCenter
- getBottomLeft
- getBottomRight
- getBounds
- getCenter
- getLeftCenter
- getRightCenter
- getTopCenter
- getTopLeft
- getTopRight
From Phaser.GameObjects.Components.Lighting:
From Phaser.GameObjects.Components.Mask:
From Phaser.GameObjects.Components.Origin:
From Phaser.GameObjects.Components.RenderNodes:
From Phaser.GameObjects.Components.RenderSteps:
From Phaser.GameObjects.Components.ScrollFactor:
From Phaser.GameObjects.Components.Size:
From Phaser.GameObjects.Components.TextureCrop:
From Phaser.GameObjects.Components.Tint:
From Phaser.GameObjects.Components.Transform:
- copyPosition
- getLocalPoint
- getLocalTransformMatrix
- getParentRotation
- getWorldPoint
- getWorldTransformMatrix
- setAngle
- setPosition
- setRandomPosition
- setRotation
- setScale
- setW
- setX
- setY
- setZ
From Phaser.GameObjects.Components.Visible:
From Phaser.GameObjects.GameObject:
- addedToScene
- addToDisplayList
- addToUpdateList
- destroy
- disableInteractive
- getData
- getDisplayList
- getIndexList
- incData
- removedFromScene
- removeFromDisplayList
- removeFromUpdateList
- removeInteractive
- setActive
- setData
- setDataEnabled
- setInteractive
- setName
- setState
- setVertexRoundMode
- toggleData
- toJSON
- update
- willRender
- willRoundVertices
From Phaser.Physics.Arcade.Components.Acceleration:
From Phaser.Physics.Arcade.Components.Angular:
From Phaser.Physics.Arcade.Components.Bounce:
From Phaser.Physics.Arcade.Components.Collision:
- addCollidesWith
- removeCollidesWith
- resetCollisionCategory
- setCollidesWith
- setCollisionCategory
- willCollideWith
From Phaser.Physics.Arcade.Components.Debug:
From Phaser.Physics.Arcade.Components.Drag:
From Phaser.Physics.Arcade.Components.Enable:
From Phaser.Physics.Arcade.Components.Friction:
From Phaser.Physics.Arcade.Components.Gravity:
From Phaser.Physics.Arcade.Components.Immovable:
From Phaser.Physics.Arcade.Components.Mass:
From Phaser.Physics.Arcade.Components.Pushable:
From Phaser.Physics.Arcade.Components.Size:
From Phaser.Physics.Arcade.Components.Velocity: