Yar

Sign in to follow this  
  • entries
    208
  • comments
    383
  • views
    65546

More masking...

Sign in to follow this  
H_o_p_s

76 views

Okay... found out that I could clip my Graphics2D object with a shape. So I decided that the shape that I would use would be an area, for obvious reasons. When you add a tile, it makes adds an area in the shape of a tile to that mapY's mask. The only problem is that now when I goto clip with that area I get this:

Exception in thread "main" java.lang.NullPointerException
at java.awt.geom.Area.(Area.java:54)
at sun.java2d.SunGraphics2D.intersectByArea(SunGraphics2D.java:628)
at sun.java2d.SunGraphics2D.intersectShapes(SunGraphics2D.java:553)
at sun.java2d.SunGraphics2D.clip(SunGraphics2D.java:2004)
at Tracker.drawClippedImage(Tracker.java:135)
at Tracker.render(Tracker.java:59)
at JavaTactics.main_loop(JavaTactics.java:85)
at JavaTactics.main(JavaTactics.java:127)


But my area is NOT nulled, so I thought that it might be that not all of the area is connected... still looking into this so I'm not sure yet.

However, I can render the area as a colored primitive:


As you can see the mask when rendered as a primitive has some antialiasing showing... not sure if this is what is helping create my error...

This method however, WILL work once I get why I can't clip by this area...
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now