1 |
var pointerheight = WW_getlayerheight(WW_pointerlayer);
|
2 |
var localy = WW_getlayertop(WW_pointerlayer) + pointerheight;
|
3 |
var localx = WW_getlayerleft(WW_pointerlayer);
|
4 |
var messageheight = WW_getlayerheight(WW_pointermessageobject);
|
5 |
var messagewidth = WW_getlayerwidth(WW_pointermessageobject);
|
6 |
var windowwidth = WW_getwindowwidth();
|
7 |
var windowheight = WW_getwindowheight();
|
8 |
if( localx + messagewidth > windowwidth)
|
9 |
localx = windowwidth - messagewidth;
|
10 |
if( localy + messageheight > windowheight)
|
11 |
localy = WW_getlayertop(WW_pointerlayer) - messageheight;
|
12 |
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
|
13 |
Window Width and Height
|