Here’s my problem- I’m trying to draw a circular part of a single image.
I’m doing some work on a top-down dungeon crawler sort of game, and I’m attempting to make a light radius around the player. The floor is a single image, and I need to draw only a small, circular part of it. I’ve been looking at this method:
drawImage(Image img,
int dx1,
int dy1,
int dx2,
int dy2,
int sx1,
int sy1,
int sx2,
int sy2,
Color bgcolor,
ImageObserver observer)
But, that looks like it would only draw a square subsection.
Does anyone happen to know an easier method than drawing tons of little squares to give the illusion of a circle?
Thanks
You can do this with the
setClip()method inGraphics.It needs some other work, but:
As I said, it needs more work, meaning the
QuadCurve2Dobject might need to be defined differently, but you can check the doc for that.