As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!

37,181

Views

Beginner

Level

3

Comments

Blending Modes

by Jon (Updated on 2015-10-14)


Contents

  • What are Blending Modes?
  • How to Set the Blending Mode
  • Limitations

What are Blending Modes?

When semi-transparent images are drawn (particularly when two or more overlap), the graphics engine has to know how to draw the overlapping area. This is known as blending.

Blending Modes are the equations used to determine how to draw these semi-transparent images. There's no better way to show this than through a live demo.

Isn't that neat? You may wonder which blend modes are commonly used. In reality, the majority of games get by with "Normal" (the default), "Add" and "Multiply."

How to Set the Blending Mode

Blending Modes can be set directly on an actor or an entire layer.

Set an Actor's Blending Mode

Use the "set blend mode for Actor" block (Actor > Effects) to change the actor's blend mode.

stencyl-design-mode-set-blend-mode-block

Set a Layer's Blending Mode

  1. Click on the cog icon for a Layer.
    stencyl-blend-mode-set-for-layer

  2. Set the Blend Mode in the popup.
    stencyl-blend-mode-layers-pane

Limitations

Blending modes only fully work for Flash games due to limitations with the underlying technology (OpenFL/Lime).

Some Blending Modes work on Desktop and Mobile targets but only Add, Multiply and Screen. We hope that in the future, OpenFL will support all blending modes on these targets.

Summary

  • Blending Modes determine how semi-transparent images are drawn, particularly when multiple ones overlap.
  • View our demo to determine which ones fit your needs. The vast majority of cases just need Normal, Add and Multiply.
  • You can apply a blending more to an actor or an entire layer.
Print Article Edit Article How to Edit an Article
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game, please ask a question on the forums. Thanks!

3 Comments

Jon
Updated to 3.2 standards. Setting a Blend Mode for a layer can now be done from the Scene Designer. The blocks still exist if you wish to change this at runtime.
0 9 years, 11 months ago
Jon
Updated the article to 3.0 standards.
0 10 years, 9 months ago
Leaufai
There is still mention of patch 2.5, even though that has morphed into 3.0
0 12 years, 3 months ago

Sign In to Comment