sproketboy
sproketboy

Reputation: 9462

Java draw line with textures

I'm trying to figure this out with no success. I can draw rectangles with a texture but how could I draw a line of say 4 pixels wide at an angle using a texture? Example like a / or \?

Upvotes: 0

Views: 982

Answers (1)

Joop Eggen
Joop Eggen

Reputation: 109593

use a TexturePaint.

TexturePaint paint = new TexturePaint(bufferedImage, anchorRect);
g.setPaint(paint);
g.setStroke(new BasicStroke(4.0F);

Upvotes: 2

Related Questions