Original Post
I was wondering how people made a virtual button. by a virtual button i mean a button that is user drawn and controlled. this is my code for dececting a mouse click on the button.
[source]
RECT rcSrc;
SetRect( gX, gY, gX+2, gY+2 );
int width = x+w;
int height = y+h;
if(x >= rcSrc.left && width <= rcSrc.right )
// commented on purpse, just checking x value until i figure it out.
//( y > rcSrc.top && y+h < rcSrc.bottom ) )
return true;
else
return false;
[/source]
but it won't work right. i just cant seem to figure it out. I'm using direct draw because I'm only doing simple 2d gaming.
Also, is there any input on which is better for mouse and keyboard input (not critical on speed just dependable) win32 or direct input. b/c direct input is a hunk of poo.
[source]
RECT rcSrc;
SetRect( gX, gY, gX+2, gY+2 );
int width = x+w;
int height = y+h;
if(x >= rcSrc.left && width <= rcSrc.right )
// commented on purpse, just checking x value until i figure it out.
//( y > rcSrc.top && y+h < rcSrc.bottom ) )
return true;
else
return false;
[/source]
but it won't work right. i just cant seem to figure it out. I'm using direct draw because I'm only doing simple 2d gaming.
Also, is there any input on which is better for mouse and keyboard input (not critical on speed just dependable) win32 or direct input. b/c direct input is a hunk of poo.