[java] Masking
Okay... the dirty rect Idea isn't working because of the tile overlaps... but its okay! I have a new idea!!
Let us say that this is our rendered map. If we make a mask for each layer, with a different colour we get this (blended witht the original for clarity):
I'll have these buffers:
MapBuffer (where the initial map is drawn. it won't be changed)
MaskBuffer (Where the masking image will be drawn)
ActorBuffers (where the sprites for actors are)
BufferStrategyBuffer
So the drawing method would look like this:
Copy over the MapBuffer to the BufferStrategy
Draw All my Actors, but masking the correct colors from the color mask
strategy.show()
So the things I need to know are:
1)Is it possible to mask a BufferedImage based on the colors of another BufferedImage?
2)Replace java.awt.Color with another 100% alpha, or a different RGBA color
Thanks in advance!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement