Untested small code snippet; example code
No guarantee! If it blows up your computer, its not my fault
Code:
// ==================================================================
// File: Code Snippet
// Type: C-Script
// Requirements: A6.31 and above
// Description: Panel that can be dragged using the mouse
// ==================================================================
// ==================================================================
// FUNCTION PROTOTYPE
function drag_panel(panel);
// ==================================================================
// PANELS
panel* drag_pan;
panel test_pan
{
bmap = bla_map;
on_click = drag_panel; //important!
}
// ==================================================================
// FUNCTION
function drag_panel(panel)
{
var diff[3];
drag_pan = panel;
diff.x = mouse_pos.x - drag_pan.pos_x;
diff.y = mouse_pos.y - drag_pan.pos_y;
while(mouse_left)
{
drag_pan.pos_x = mouse_pos.x - diff.x;
drag_pan.pos_y = mouse_pos.y - diff.y;
wait(1);
}
}
// ==================================================================
// END OF FILE
// ==================================================================