No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I am writing a game in which I need to draw text onto the screen. As I understand it there are two main ways to do this using Graphics2D - using GlyphVector and using drawString(). Of the two I prefer the previous because it allows me to define text as … |
|
I'm using Swing's GeneralPath to create complex shapes and fill them. Usually I do this, and it creates a nice hexagon for me: [CODE] path.moveTo(100, 100); path.lineTo(150, 100); path.lineTo(180, 150); path.lineTo(150, 200); path.lineTo(100, 200); path.lineTo(70, 150); path.lineTo(100, 100); g2.draw(path);[/CODE] Suppose I wanted to create a donut-shaped GeneralPath, and do this: … |
|
I'm creating a game in which I draw polygons of varying sizes and shapes using awt/Graphics2D. To smooth out the polygons, I want to use series of cubic Bezier curves to make smoother edges. I spent some time poking around the Java awt and swing classes and saw the Bezier … |