New TFT Extension Library

UPDATE: 4/14/2014

Ok this update has the new polygon and drawStar functions, as well as a new version of the all the Triangle functions.

The polygon and drawStar functions need a single X,Y coordinate, the polygon function, also needs a number of sides(3 - 360) anything more and the function doesn't work. You can also give it a color (still working on how to fill the polygon) and a degree if needed. The drawStar function needs a diameter, a color and a factor (1.0 - 4.0) which is preset to 2.0. This factor controls the thickness of the star. The higher the number, the thinner the star gets, and the factor will not go lower than 1.0 or higher than 4.0

Now with the triangle functions, you don't need to specify a direct like "up, down ,left or right" and also give a degree. The new functions only need the X,Y coords, a base length and a degree. I did leave in the up, down, left and right as degrees, so up = 0 deg, left = 90 deg, down = 180, and right = 270. You can also use these as " up + 45" which is just 45 degrees, or "down - 27" which equals 153 deg.

Example:
myTFT.drawStar(160, 120, 30, WHITE);
myTFT.drawStar(160, 120, 30, WHITE, 3.0); // this star is thinner than the one above.

myTFT.Polygon(50, 50, 3, 20, BLUE); // X, Y, sides, diameter

myTFT.drawTriangle(160, 120, 50, up + 45);
myTFT.drawTriangle(160, 120, 50, right);
myTFT.drawTriangle(160, 120, 50, down - 27);

I am still working on being able to fill in the star and polygon shapes, but for now this should do.

TFT_Extension.zip (40.2 KB)