13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Display programming<br />

Applying bl<strong>en</strong>ding modes<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

Bl<strong>en</strong>ding modes involve combining the colors of one image (the base image) with the colors of another image (the<br />

bl<strong>en</strong>d image) to produce a third image—the resulting image is the one that is actually displayed on the scre<strong>en</strong>. Each<br />

pixel value in an image is processed with the corresponding pixel value of the other image to produce a pixel value for<br />

that same position in the result.<br />

Every display object has a bl<strong>en</strong>dMode property that can be set to one of the following bl<strong>en</strong>ding modes. These are<br />

constants defined in the Bl<strong>en</strong>dMode class. Alternatively, you can use the String values (in par<strong>en</strong>theses) that are the<br />

actual values of the constants.<br />

Bl<strong>en</strong>dMode.ADD ("add"): Commonly used to create an animated light<strong>en</strong>ing dissolve effect betwe<strong>en</strong> two images.<br />

Bl<strong>en</strong>dMode.ALPHA ("alpha"): Commonly used to apply the transpar<strong>en</strong>cy of the foreground on the background.<br />

(Not supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.DARKEN ("dark<strong>en</strong>"): Commonly used to superimpose type. (Not supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.DIFFERENCE ("differ<strong>en</strong>ce"): Commonly used to create more vibrant colors.<br />

Bl<strong>en</strong>dMode.ERASE ("erase"): Commonly used to cut out (erase) part of the background using the foreground<br />

alpha. (Not supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.HARDLIGHT ("hardlight"): Commonly used to create shading effects. (Not supported under GPU<br />

r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.INVERT ("invert"): Used to invert the background.<br />

Bl<strong>en</strong>dMode.LAYER ("layer"): Used to force the creation of a temporary buffer for precomposition for a particular<br />

display object. (Not supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.LIGHTEN ("light<strong>en</strong>"): Commonly used to superimpose type. (Not supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.MULTIPLY ("multiply"): Commonly used to create shadows and depth effects.<br />

Bl<strong>en</strong>dMode.NORMAL ("normal"): Used to specify that the pixel values of the bl<strong>en</strong>d image override those of the base<br />

image.<br />

Bl<strong>en</strong>dMode.OVERLAY ("overlay"): Commonly used to create shading effects. (Not supported under GPU<br />

r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.SCREEN ("scre<strong>en</strong>"): Commonly used to create highlights and l<strong>en</strong>s flares.<br />

Bl<strong>en</strong>dMode.SHADER ("shader"): Used to specify that a Pixel B<strong>en</strong>der shader is used to create a custom bl<strong>en</strong>ding<br />

effect. For more information about using shaders, see “Working with Pixel B<strong>en</strong>der shaders” on page 300. (Not<br />

supported under GPU r<strong>en</strong>dering.)<br />

Bl<strong>en</strong>dMode.SUBTRACT ("subtract"): Commonly used to create an animated dark<strong>en</strong>ing dissolve effect betwe<strong>en</strong><br />

two images.<br />

Last updated 6/6/2012<br />

186

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!