You’re reading the docs for Phaser v3.90.0. The latest is Phaser v4.1.0.

Types.GameObjects.Graphics

Phaser.Types.GameObjects.Graphics

FillStyle

staticFillStyle

Graphics fill style settings.

nametypeoptionaldescription
colornumberYesThe fill color.
alphanumberYesThe fill alpha.

Type: object

Member of: Phaser.Types.GameObjects.Graphics

Source: src/gameobjects/graphics/typedefs/FillStyle.js#L1
Since: 3.0.0


LineStyle

staticLineStyle

Graphics line style (or stroke style) settings.

nametypeoptionaldescription
widthnumberYesThe stroke width.
colornumberYesThe stroke color.
alphanumberYesThe stroke alpha.

Type: object

Member of: Phaser.Types.GameObjects.Graphics

Source: src/gameobjects/graphics/typedefs/LineStyle.js#L1
Since: 3.0.0


Options

staticOptions

Options for the Graphics Game Object.

nametypeoptionaldescription
xnumberYesThe x coordinate of the Graphics.
ynumberYesThe y coordinate of the Graphics.

Type: object

Member of: Phaser.Types.GameObjects.Graphics

Source: src/gameobjects/graphics/typedefs/Options.js#L1
Since: 3.0.0


RoundedRectRadius

staticRoundedRectRadius

nametypeoptionaldefaultdescription
tlnumberYes20Top left corner radius. Draw concave arc if this radius is negative.
trnumberYes20Top right corner radius. Draw concave arc if this radius is negative.
brnumberYes20Bottom right corner radius. Draw concave arc if this radius is negative.
blnumberYes20Bottom left corner radius. Draw concave arc if this radius is negative.

Type: object

Member of: Phaser.Types.GameObjects.Graphics

Source: src/gameobjects/graphics/typedefs/RoundedRectRadius.js#L1
Since: 3.11.0


Styles

staticStyles

Graphics style settings.

nametypeoptionaldescription
lineStylePhaser.Types.GameObjects.Graphics.LineStyleYesThe style applied to shape outlines.
fillStylePhaser.Types.GameObjects.Graphics.FillStyleYesThe style applied to shape areas.

Type: object

Member of: Phaser.Types.GameObjects.Graphics

Source: src/gameobjects/graphics/typedefs/Styles.js#L1
Since: 3.0.0