Using Ink Masks

   

Another ink effect, called Mask ink, can also be used to composite a sprite. Mask ink is unusual in that it requires a second cast memberan ink mask as a reference. An ink mask is essentially a map that shows Director which parts of a sprite to make transparent and which to leave opaque . Director always looks for the ink mask in the same place: in the Cast window, directly following the cast member that the sprite refers to ( Figure 8.16 ).

Figure 8.16. An ink mask must always be placed in the Cast window immediately following the cast member it's associated with.

graphics/08fig16.gif

You can create an ink mask in Director's Paint window, or you can import it from an external paint program. If you create your cast members in Photoshop or another image-editing program that supports masks, you can create the ink mask at the same time you create the original cast member. (For one way to do this, see the sidebar, "A Quick Detour into Photoshop," later in this chapter.)

Using the Mask ink effect has a couple of advantages over using the Background Transparent or Matte ink effects. First, through the use of an ink mask, any part of a sprite can be made transparent, regardless of the color of its pixels. And second, the Mask ink effect allows for levels of semi-transparency, which the Background Transparent and Matte ink effects do not.

The main drawback of using the Mask ink effect is that creating an ink mask requires some time and effort. Also, each ink mask you use increases the number of cast members and therefore adds to the size of your movie file.

To create and use an ink mask:

  1. In the Cast window, select the cast member for which you want to create an ink mask.

  2. Choose Edit > Duplicate.

    Director creates a duplicate cast member and selects it in the Cast window.

    This cast member will be the ink mask, so you may want to give it a name that identifies it as a mask ( Figure 8.17 ).

    Figure 8.17. Create a duplicate cast member that will become an ink mask.

    graphics/08fig17.gif

  3. With the duplicate cast member still selected, choose Modify > Transform Bitmap.

    The Transform Bitmap dialog box opens ( Figure 8.18 ).

    Figure 8.18. The Transform Bitmap dialog box, showing appropriate settings for an 8-bit ink mask.

    graphics/08fig18.gif

  4. Make a selection from the Color Depth pop-up menu:

    Choose 8 bits if you want to create a mask that has varying levels of transparency.

    or

    Choose 1 bit if you want to create a mask with only fully opaque and fully transparent areas. (A 1-bit mask adds barely anything to the movie's file size.)

  5. If you selected 8 bits as your color depth, choose Grayscale from the Palette pop-up menu.

  6. Click the Remap Colors radio button.

  7. Click Transform.

    A dialog box asks you to confirm that you want to transform the cast member.

  8. Click OK.

  9. Double-click the transformed cast member to open it in the Paint window ( Figure 8.19 ).

    Figure 8.19. Open the cast member in the Paint window.

    graphics/08fig19.gif

  10. In the Paint Tool palette, click the Paint Bucket, Paint Brush, or any other paint tool.

  11. "Color in" the cast member as follows :

    Use white to indicate areas where you want the sprite to be fully transparent.

    Use black to indicate areas where you want the sprite to be fully opaque.

    Use varying levels of gray to indicate semi-transparent areas, with lighter grays indicating greater transparency and darker grays indicating greater opacity ( Figure 8.20 ).

    Figure 8.20. The same cast member, repainted to serve as an ink mask.

    graphics/08fig20.gif

  12. In the Cast window, make sure that the duplicate cast member immediately follows the original version of the cast member.

  13. If you haven't done so already, drag the original cast member to the Stage or Score to create a sprite. (The ink mask does not get placed on the Stage or in the Score.)

  14. Select the sprite.

  15. In the Property Inspector, select the Sprite tab.

  16. From the Ink menu, choose Mask ( Figure 8.21 ).

    Figure 8.21. Choose Mask from the Ink menu.

    graphics/08fig21.gif

    Portions of the sprite become transparent or semi-transparent as specified in the ink mask ( Figure 8.22 ).

    Figure 8.22. The masked sprite on the Stage contains both opaque and transparent areas, resulting in a more realistic image.

    graphics/08fig22.gif

To use an imported ink mask:

  1. Create an image in an external program, such as Photoshop.

    At the same time you create the image, follow the instructions in your image-editing program to create a mask for the image. (For one way to do this, see the "Quick Detour into Photoshop" sidebar later in this chapter.)

  2. In your image-editing program, save the image and the mask as separate files.

    The mask should be saved as a 1-bit file (if it contains no gray areas) or an 8-bit grayscale file.

    To save on file size, you may also want to save the image as an 8-bit file rather than a 32-bit file.

  3. Import the image and the mask into Director.

  4. Double-click the mask in the Cast window to open it in the Paint window.

  5. Look at the mask to make sure the colors are displayed correctly for Director.

    Depending on how the mask was made and where it was imported from, it may show opaque areas in white and transparent areas in black ( Figure 8.23 ). This is the reverse of the way ink masks work in Director.

    Figure 8.23. This mask, imported from Photoshop, has values opposite from those that Director expects. This glass full of beer, for example, has transparent areas appear as black.

    graphics/08fig23.gif

    If the colors in the mask are indeed reversed , do the following:

    • Double-click the Marquee tool in the Paint Tool palette to select the entire mask.

    • Click the Invert Colors tool on the Effects toolbar ( Figure 8.24 ).

      Figure 8.24. Click to invert the colors in the mask.

      graphics/08fig24.gif

    Each color in the mask changes to its opposite ( Figure 8.25 ).

    Figure 8.25. The revised mask, suitable for use as a Director ink mask.

    graphics/08fig25.gif

  6. Follow steps 10 through 13 of the previous task, "To create and use an ink mask."

   


Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
Macromedia Director MX for Windows and Macintosh. Visual QuickStart Guide
ISBN: 1847193439
EAN: N/A
Year: 2003
Pages: 139

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net