When advancing the sprite and mask, the colors are absolute important. The affectation pixels are 0 (black) wherever the agnate sprite pixel is to be displayed, and 1 (white) wherever the accomplishments needs to be preserved. The sprite have to be 0 (black) anywhere area it is declared to be transparent, but agenda that atramentous can be acclimated in the non-transparent regions
In the aboriginal blit, the affectation is blitted assimilate the accomplishments application the raster abettor of AND. Because any amount ANDed with 0 equals 0, and any amount ANDed with 1 is unchanged, atramentous areas are created area the absolute sprites will appear, while abrogation the blow of the accomplishments alone.
In the additional blit, the sprite is blitted assimilate the anew adapted accomplishments application the raster abettor of OR. Because any amount ORed with 0 is unchanged, the accomplishments is artless and the atramentous areas are abounding with the absolute sprite image
It is aswell accessible to accomplish the aforementioned aftereffect application a sprite with a white accomplishments and a white-on-black mask. In this case, the affectation would be ORed first, and the sprite ANDed next
In the aboriginal blit, the affectation is blitted assimilate the accomplishments application the raster abettor of AND. Because any amount ANDed with 0 equals 0, and any amount ANDed with 1 is unchanged, atramentous areas are created area the absolute sprites will appear, while abrogation the blow of the accomplishments alone.
In the additional blit, the sprite is blitted assimilate the anew adapted accomplishments application the raster abettor of OR. Because any amount ORed with 0 is unchanged, the accomplishments is artless and the atramentous areas are abounding with the absolute sprite image
It is aswell accessible to accomplish the aforementioned aftereffect application a sprite with a white accomplishments and a white-on-black mask. In this case, the affectation would be ORed first, and the sprite ANDed next
No comments:
Post a Comment