var pointerheight = WW_getlayerheight(WW_pointerlayer);
|
var localy = WW_getlayertop(WW_pointerlayer) + pointerheight;
|
var localx = WW_getlayerleft(WW_pointerlayer);
|
var messageheight = WW_getlayerheight(WW_pointermessageobject);
|
var messagewidth = WW_getlayerwidth(WW_pointermessageobject);
|
var windowwidth = WW_getwindowwidth();
|
var windowheight = WW_getwindowheight();
|
if( localx + messagewidth > windowwidth)
|
localx = windowwidth - messagewidth;
|
if( localy + messageheight > windowheight)
|
localy = WW_getlayertop(WW_pointerlayer) - messageheight;
|
This code, uses sizes of window, pointer and mouse over message to position latter so it always visible
-
Initial choice is starting below bottom left corner of pointer
-
If no room to right, the shift so ends at window right boundary
-
If no room below pointer, place above it
|
Window Width and Height
|