Hi
just need help on my assignment, im trying to draw
pattern onto the canvas so that the whole canvas is covered with that pattern. At the moment ive drawn a polygon shape and it only draws it in the x axis horizontally across the canvas but not vertically!!! below is a snipet of my code
many thanks
if(patterntype == "PM")
g.setColor(new Color(255,0,0));
int xPoints[] = { 20, 40, 50, 30, 20, 15 };
int yPoints[] = { 50, 50, 60, 80, 80, 60 };
int numPoints = xPoints.length;
Polygon polygon = new Polygon( xPoints, yPoints, numPoints);
g.fillPolygon(polygon);
} // end of paint
if(!tiled)
{
for(int x=0;x<xPoints.length;x++)
for(int y=0;y<xPoints.length;y++)
{
g.drawPolygon(xPoints, yPoints, xPoints.length);
for(int i=0; i<xPoints.length;i++)
xPoints[i] += 90;
g.setColor(new Color(255,0,0));
g.drawPolygon(xPoints, yPoints, xPoints.length);
}
}