I did that that was just a unnoticed byproduct. The acctual problem is I
cannot get the RECT info into the function.
if (ClickButton(exit,340,470,490,510) == TRUE)
PostQuitMessage(0);
else G.currGameState = GAMESTATE_NMENU;
break;
}
And here is the function:
BOOL ClickButton(RECT szRectName,int l,int t,int r,int b)
{
if ((g_x < szRectName.left) && (g_x > szRectName.right))
LeftRight = TRUE;
else LeftRight = FALSE;
if ((g_y > szRectName.top) && (g_y < szRectName.bottom))
TopBottom = TRUE;
else TopBottom = FALSE;
if ((LeftRight = TRUE) && (TopBottom = TRUE))
return TRUE;
else return FALSE;
}
----- Original Message -----
From: "Elias Pschernig" <eli...@ao...>
To: <dev...@li...>
Sent: Thursday, May 17, 2001 1:14 PM
Subject: Re: [Dev-C++] help please
> > Does any one see any errors here? It compiles fine it just doesn't
> WORK!:(
> > BOOL LeftRight;
> > BOOL TopBottom;
> >
> > BOOL ClickButton(RECT szRectName)
> > {
> > if ((g_x > szRectName.left) && (g_x < szRectName.right))
> > LeftRight = TRUE;
> > else LeftRight = FALSE;
> >
> > if ((g_y < szRectName.top) && (g_y > szRectName.bottom))
>
> I think you want to swap the < and > in the above line.
>
> Elias Pschernig
>
>
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> http://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|