Skip to main content
Version: Phaser v4.0.0

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

nametypeoptionaldescription
scenePhaser.SceneNoThe Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
xnumberNoThe horizontal position of this Game Object in the world.
ynumberNoThe vertical position of this Game Object in the world.
texturestring | Phaser.Textures.TextureNoThe key, or instance of the Texture this Game Object will use to render with, as stored in the Texture Manager.
framestring | numberYesAn 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:

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:

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:

From Phaser.GameObjects.Components.Alpha:

From Phaser.GameObjects.Components.BlendMode:

From Phaser.GameObjects.Components.Depth:

From Phaser.GameObjects.Components.Filters:

From Phaser.GameObjects.Components.Flip:

From Phaser.GameObjects.Components.GetBounds:

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:

From Phaser.GameObjects.Components.Visible:

From Phaser.GameObjects.GameObject:

From Phaser.Physics.Arcade.Components.Acceleration:

From Phaser.Physics.Arcade.Components.Angular:

From Phaser.Physics.Arcade.Components.Bounce:

From Phaser.Physics.Arcade.Components.Collision:

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: