Username or E-mail
Password (Forgot?)
New? Sign Up
Join or Sign In
Forums Stencylpedia Stencyl TV Translations Go Pro - Plans & Pricing Download Stencyl


Switch to Book Layout

1: Getting Started

  • Getting Started
  • Crash Course
  • Crash Course 2
  • StencylForge

2: Building Logic

  • What is a Behavior?
  • Creating a Behavior
  • Attributes
  • Game Attributes
  • Attribute Types
  • Events
  • Our Behaviors

3: Actors

  • What are Actors?
  • Animations
  • Motion & Forces
  • Physics
  • Controls
  • Collisions & Groups
  • Killing vs. Recycling
  • Tweening
  • Effects
  • Chapter 3 Challenge

4: Scenes

  • Scene Basics
  • The Camera
  • Tilesets
  • Regions
  • Drawing Text & HUDs
  • Changing Scenes
  • Music, Sounds & Channels
  • Backgrounds
  • Customizing Actors
  • Chapter 4 Challenge

5: Game Mechanics

  • Saving
  • Pausing
  • 3rd Party Services
  • Web Requests

6: Advanced Topics

  • Get/Set Attributes
  • Custom Events
  • Blending Modes
  • Lists
  • Custom Blocks
  • Continuous Collisions

7: Testing & Tuning

  • Testing Games
  • Optimizing Performance 1
  • Optimizing Performance 2

8: The Last 10%

  • Flash Publishing
  • Standalone Apps
  • iOS App Store
  • Chrome Store
  • Making Money

M1: Mobile - Intro

  • Getting Started
  • Testing on your Device
  • Flash -> iOS Guide

M2: Mobile - Basics

  • Atlases
  • Drawing Text
  • Retina Display
  • Accelerometer
  • Joystick
  • Universal Games

M3: Mobile - Services

  • iAds
  • Game Center
  • In-App Purchases

M4: Mobile - Publishing

  • Debugging
  • Publishing to the App Store
  • Optimizing Performance
  • Promoting your Game

A: Troubleshooting

  • Showstoppers
  • General FAQ
  • iOS FAQ
  • The 90% Memory Warning
  • Recovering Broken Games
  • Can't Export to SWF
  • Reloading Documents
  • Generating Logs
  • Flash Security Settings
  • How to Report Bugs

B: How-To Guides

  • Importing Assets
  • Scene Designer
  • Code Mode
  • Font Editor
  • Pencyl (Image Editor)
  • Tile Editor (Shapes)
  • Game Cleaner

C: Reference

  • Glossary
  • Block Reference
  • Useful Shortcuts
  • Stencyl API

D: Resources

  • Stencyl TV
  • Abigayl's Guides
  • Giving Critiques
  • Creating Extensions
  • Translating Stencyl
  • Credits

3.0 Drafts (In Progress)

  • What's New in Stencyl 3.0?
  • Setup (Android)
  • Setup (Desktop)
  • Setup (iOS) - Concepts
  • Setup (iOS) - Mac
  • Setup (iOS) - Windows
  • Testing iOS on Windows
  • iOS Troubleshooter

  • Mobile App Scaling
  • Full Screen Mode
  • Simple Physics
  • Backgrounding an App

  • iOS App Store
  • Mac App Store
  • Windows Store
  • Google Play
  • HTML5

  • Android Ads
  • Android Purchases (WIP)
  • 4" Form Factor (iPhone 5)
  • Mobile Input
  • Mobile Features

  • Extending the Engine
  • iOS / Android Extensions
  • Developing the Official Extensions
  • Developing the Engine

  • iAds (Revised)
  • Game Center (Revised)
  • iOS Purchases (Revised)
  • Atlases (Revised)
  • Drawing Text (Revised)
  • Joystick (Revised)
  • Accelerometer (Revised)
  • Sounds (Revised, WIP)
  • Debugging (Revised, WIP)
  • iOS Performance (Revised)
Level: Beginner

Blending Modes

Contents

  • What are Blending Modes?
  • How to Set the Blending Mode
  • The Future

 

What are Blending Modes?

When semi-transparent images are drawn, and 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. We support 13 modes in total. There's no better way to show this than through a live demo.

Pretty neat, eh? But you may wonder which ones really matter.

In reality, the majority of games get by with just "Normal" (the default), "Add" and "Multiply."

 

How to Set the Blending Mode

Blending Modes can only be set during custom drawing, which is to say, only inside the "when drawing" event.

If you'd like an entire actor to draw in a semi-transparent fashion and use a different blending mode than the "normal" mode, you'll want to use the following approach.

  1. Use the "hide sprite" block (Actor > Draw) to turn off regular drawing for this actor.

    stencyl-design-mode-hide-sprite-block
     
  2. Then draw the actor inside a "when drawing" event like follows. The key aspect is using the "draw image" block, which will draw the current image for this actor

    stencyl-design-mode-blend-mode-blocks

 

The Future

Currently, blending modes beyond a "normal" blend only work for web (Flash) games. Blending Mode support will be improved in Stencyl 3.0 by becoming a direct property you can set on an Actor or an entire Layer.

 

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.
  • To apply blending modes to an actor's animations, use the "hide sprite" block and then manually draw the image using the "draw image for [self]" block.

 

Challenge: Name that Game

Although most games can get by with Normal, Add and Multiply, can you cite instances (from real, shipping games) where other blending modes have clearly been used?



Last Updated: 2013-01-29 by Jon

6964 have read this article
Disclaimer: The Stencyl Team does not actively monitor comments on articles. If you're seeking help for your game, please ask a question on the forums. Thanks!
1 Comment
Leaufai
There is still mention of patch 2.5, even though that has morphed into 3.0
0 9 months, 2 weeks ago



Commenting Guidelines

Sign In to Comment

Make Games

  • What is Stencyl?
  • Roadmap
  • Pricing

Play

  • Arcade
  • Showcase

Community

  • Forums
  • Chat
  • Translations

Help

  • Stencylpedia
  • Stencyl TV

About Us

  • Blog
  • Contact Us
  • Press
  • Privacy
Follow Stencyl on Twitter



© 2013 Stencyl, LLC.