but how else i know i'm clicking on panel or not? Here's an example from GameStudio manual:
/////////////////////////////////////////////////////////////
panel.on_click
Instead of the 'global' ON_CLICK function, this given function is performed by left clicking with the mouse pointer anywhere within the panel bitmap, as long as no panel element (like a button) is hit. The panel pointer is passed as optional parameter to the function and can be used for determining which panel was clicked on.
Example:
function redblue(panel); //prototype
PANEL* redpan = { x = 10; y = 20; bmap = redmap; on_click = redblue; }
PANEL* bluepan = { x = 10; y = 40; bmap = bluemap; on_click = redblue; }
function redblue(panel)
{
if (panel == redpan) { print("redpan clicked!"); }
if (panel == bluepan) { print("bluepan clicked!"); }
}
///////////////////////////////////////////////
As you can see,functio on_click are used in panel