They are four lines plus 4 halves of a circle... so you should have a prototype like
void drawRoundedBox(uint16 x0, uint16 y0, uint16 x1, uint16 y1, uint16 ray);
So...
Code: Select all
void drawRoundedBox(uint16 x0, uint16 y0, uint16 x1, uint16 y1, uint16 ray){
if(x0>x1)ROTATE(uint16, x0, x1); //This is a macro..
if(y0>y1)ROTATE(uint16, y0, y1);
//You should also make controls on the length of the ray
uint16 x0v=x0+ray;
uint16 x1v=x1-ray;
drawLine(x0v,y0,x1v,y0); //Upper line
drawLine(x0v,y1,x1v,y1); //Bottom line
uint16 y0v=y0+ray;
uint16 y1v=y1-ray;
drawLine(x0,y0v,x1,y0); //Upper line
drawLine(x0,y1v,x1,y1); //Bottom line
//And now the circles....
circle(x0v,y0v,180,90); //Center x, center y, from angle to angle
circle(x1v,y0v,90,0);
circle(x0v,y1v,270,180);
circle(x1v,y1v,360,270);
}