Multicolor Buttons
Let's take a look at one more quick project with 2-bit overlays. Instead of gaining access to six effective colors for buttons, let's make one interesting, multicolor overlay button. We'll head back to our Hawaii tour over the volcano and turn out a quick menu with fancy buttons.
The mask of the red death
Well, this isn't as horrific as Poe's mask, but we're going to use our mask to produce some nice red lava on a volcano. And for a change, we're going to use the mask for the button text as well. Figure 4-51 shows the grayscale version of the mask.

Figure 4-51. A 2-bit mask for a multicolored button and some text
We intend to use the mask for all the menu options here. This isn't common, but it enables us to be remarkably flexible in our background choices. We can use a layered menu, a standard menu, a standard menu with music, or even a full-video background. In fact, let's go the full-video route.
Note
One other thing to remember when building your mask is that fonts should not be antialiased if you're using your shades of gray for distinct colors. Having the occasional red pixel show up around the edges of your light-blue text is not often a desirable thing!
Multicolor button demonstration
Start a new project in DVDSP and import the following files from the projects/ch04 folder:
overlay_scaled.gif
volcano.m2v
volcano.AC3
Notice that we didn't include any menu files ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access