• entries
208
383
• views
65870

93 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...

There are no comments to display.

## Create an account

Register a new account