Phaser API Documentation

  Version: 
setConstraintRenderStyle(constraint, [lineColor], [lineOpacity], [lineThickness], [pinSize], [anchorColor], [anchorSize])

Description:

Sets the debug render style for the given Matter Constraint.

If you are using this on a Phaser Game Object, then pass in the body property to this method, not the Game Object itself.

If you wish to skip a parameter, so it retains its current value, pass false for it.

If you wish to reset the Constraint render colors to the defaults found in the World Debug Config, then call this method with just the constraint parameter provided and no others.

Parameters:

name type arguments description
constraint MatterJS.ConstraintType

The Matter Constraint to set the render style on.

lineColor number <optional>

The line color. If null it will use the World Debug Config value.

lineOpacity number <optional>

The line opacity, between 0 and 1. If null it will use the World Debug Config value.

lineThickness number <optional>

The line thickness. If null it will use the World Debug Config value.

pinSize number <optional>

If this constraint is a pin, this sets the size of the pin circle. If null it will use the World Debug Config value.

anchorColor number <optional>

The color used when rendering this constraints anchors. If null it will use the World Debug Config value.

anchorSize number <optional>

The size of the anchor circle, if this constraint has anchors. If null it will use the World Debug Config value.

Returns:
Description:

This Matter World instance for method chaining.

Since: 3.22.0