Pass:setBlendMode

Edit

Sets the blend mode. When a pixel is drawn, the blend mode controls how it is mixed with the color and alpha of the pixel underneath it.





Sets the blend mode for all canvas textures.

Arguments

NameTypeDescription
blendBlendMode The blend mode.
alphaBlendBlendAlphaMode The alpha blend mode, used to control premultiplied alpha.

Returns

Nothing

Disables blending. When something is drawn, its pixel colors will replace any existing color in the target texture. This can work okay for opaque objects, but won't render text or transparency properly.

Arguments

None

Returns

Nothing

Sets the blend mode for a single canvas texture.

Arguments

NameTypeDescription
indexnumber The index of the canvas texture that will use the new blend mode.
blendBlendMode The blend mode.
alphaBlendBlendAlphaMode The alpha blend mode, used to control premultiplied alpha.

Returns

Nothing

Disables blending for a single canvas texture.

Arguments

NameTypeDescription
indexnumber The index of the canvas texture that will use the new blend mode.

Returns

Nothing

Notes

The default blend mode is alpha with the alphamultiply alpha mode.

See also