Jump to content
  • Advertisement
Sign in to follow this  

[java] Masking

This topic is 4829 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!!

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!