Game Development Reference
In-Depth Information
Transparency
One area that changed significantly in Game Maker 8 is the way that transparency works for
sprites. Previous versions of Game Maker have only allowed one color to be transparent for each
sprite, which meant that the pixels of sprites were either fully transparent or fully opaque (that is,
nothing can be seen through it). This allowed simple punch-through transparency, where a single
background color within the sprite is not drawn (see Figure 1-5). However, the edges of sprites
could often seem quite harsh and jagged using this method—particularly when there was a large
contrast in color between the sprites and the background behind them (see Figure 1-6, left).
Fortunately, Game Maker 8 supports a more advanced kind of transparency by which every
pixel in a sprite can have its own level of opacity from 0 (fully transparent) to 255 (fully opaque).
Opaque just means the opposite of transparent, so this value represents how hard it is to see
through something. A low value means that it is easy to see through it (with a value of zero being
invisible), and a high value means that it is hard to see through it (with a value of 255 being
unable to see through it at all). A more general term for this measure in computer graphics is
alpha , but you will come across both the terms opacity and alpha in Game Maker.
Figure 1-5. A sprite displayed in front of a background with and without punch-through transparency
Figure 1-6. The jagged edges produced by punch-through transparency (left) compared to the smoother
edges produced by alpha transparency (right)
 
Search WWH ::




Custom Search