Code: Select all
{
MouseIsInsideRectangle[ (left, top, right, bottom)
{
MOUSE_X=GetMousePosX();
MOUSE_Y=GetMousePosY();
if(MOUSE_X<left)
{
return 0;
}
if(MOUSE_X>right)
{
return 0;
}
if(MOUSE_Y<top)
{
return 0;
}
if(MOUSE_Y>bottom)
{
return 0;
}
return 1;
} ]
MouseIsInsideDrawnFlipbook[ (left, top, sizeX, sizeY)
{
return MouseIsInsideRectangle(left, top, left+sizeX, top+sizeY);
} ]
CheckEventWhileOnRectangle[ (left, top, right, bottom, event)
{
return (event and MouseIsInsideRectangle(left,top,right,bottom));
} ]
CheckEventWhileOnDrawnFlipbook[ (left, top, sizeX, sizeY, event)
{
return (event and MouseIsInsideDrawnFlipBook(left,top,sizeX,sizeY));
} ]
}
Code: Select all
DrawFlipBookImage(FLIPBOOK_NAME, FLIPBOOK_INDEX, 160, 120, 255, 255, 255, 255, 1 );
if(MouseIsInsideDrawnFlipbook(160, 120, 500, 300))
{
...
}
Code: Select all
DrawFlipBookImage(FLIPBOOK_NAME, FLIPBOOK_INDEX, 160, 120, 255, 255, 255, 255, 1 );
if(CheckEventWhileOnDrawnFlipbook(160, 120, 500, 300, self.lbutton_pressed))
{
...
}
Hope this helps.