Bitmap, blitting and masks


i have 2d isometric game map blitted single bitmap. have character movieclip animation on top can walk around screen.

 

in areas there things (walls etc) on game map must appear above character, not beneath. achieve this, have transparent bitmap covering character , when object needs appear above character add object's bitmapdata bitmap. whenever character moves bitmap cleared , redrawn. example, display order be: gamemap > character > wall piece .

 

my problem occurs when user goes behind element transparency. end drawing transparent element ontop of copy in game map, makes element appear less transparent.

 

i thinking try sort of mask. example, use transparent bitmap above character mask entire game map beneath , 'underneath non-transparent areas of bitmap above character, make pixels in game map bitmap transparent/hidden'.

 

i have tried doing doing bitmapdata.fillrect(rect beneath character, transparent pixel) on gamemap underneath works in removing elements, gamemap must redrawn again afterwards causes quite performance hit.

 

any ideas? thanks

why not make blitted bit beneath semi transparent element totally transparent?



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Thread: gpg: Conflicting Commands

Adobe Acrobat Pro , Terminal Server Use

when i try using AE CC 3d camera tracker after the first step it says "Analysis solve failed." help?