Checking if the mouse is with in a buttons Rect is pretty simple. you dont need SpriteCollision nor anything like that. All you have to check are 4 points agains your X and Y Coordinates, the Boxes Top, Left, Right, Bottom. I use this type of boundry detecton with in many of the projects I have done.
This is how it works:
...
int mouseX;
int mouseY;
int x = 100, y = 100, width = x + 100, height = y + 100;
// our main loop
while ( LoopGDK ( ) )
{
mouseX = dbMouseX ();
mouseY = dbMouseY ();
dbBox ( x, y, width, height );
if ( mouseX > x && mouseX < width && mouseY > y && mouseY < height )
{
dbText ( width+100, 0, "Button Collision!");
}
else
{
dbText ( width+100, 0, "No Button Collision!");
}
...
For the Circle, you would like to Find the Circumference which is (Pi*Diameter). Its kind of complicated(at least for me it is at the moment).
My Advise is to stick to Rectangular Figures or just check the Circles Rect instead of a Circle if you know what i mean. Its pretty complicated. So yeah.
You can also make some nice Buttons and windows with just Boxes, I have made some Functions for that. Its pretty simple.
void dbCreateWindow ( LPSTR lpszTitle, int ix, int iy, int iw, int ih)
{
int iw2 = ix + iw + dbTextWidth("[x]"),
ih2 = iy + ih,
itx = ix + 5,
ity = iy + 5;
double white = dbRgb( 255, 255, 255 );
double black = dbRgb( 0, 0, 0 );
double blue = dbRgb ( 0, 100, 200 );
// Window frame
dbInk ( white, white );
dbBox ( ix, iy, iw2, ih2 );
// Title bar
dbInk ( blue, blue );
dbBox ( ix, iy, iw2, iy + dbTextHeight (" ") + 10 );
// Title text
dbInk ( white, white );
dbText ( itx, ity, lpszTitle );
dbText ( iw2 - dbTextWidth("[x]"), ity-5, "[x]" );
}
Pretty Simple. You can more or less functionality to this.
Hope this was of help and if not. then I am sorry =]
Have a nice day!
If you want something, You'll find a way; If you don't, you'll find an excuse.
Education is a comitment.