Unfortunately, the game screen area is not a separeted widget.
The game screen area is the same widget of the game map panel.
It means, you need to anchor it by another way and then set a calculated margin-left and margin-top.
Something like that:
Lua:
-- This, you need to set only once in yourWidget
-- Attaching to gameRootPanel is to be able to move your widget anywhere
yourWidget:setAnchor(AnchorTop, 'gameRootPanel', AnchorTop) -- Anchors yourWidget top on top of gameRootPanel
yourWidget:setAnchor(AnchorLeft, 'gameRootPanel', AnchorLeft) -- Anchors yourWidget left on left of gameRootPanel
Lua:
-- This, you need to set for view mode that is not full screen
local mapWidget = modules.game_interface.getMapPanel()
local yourWidgetTopMargin = 4
local yourWidgetLeftMargin = 4
local mapWidgetMarginTop = mapWidget:getY() -- Top margin of mapWidget (which is the top menu height)
local mapWidgetMarginLeft = mapWidget:getX() -- Left margin of mapWidget (which is the left panels width)
local gameScreenAreaMarginTop = math.floor( ( mapWidget:getHeight() - mapWidget:getMapHeight() ) / 2 ) -- Top margin between mapWidget and the game screen area
local gameScreenAreaMarginLeft = math.floor( ( mapWidget:getWidth() - mapWidget:getMapWidth() ) / 2 ) -- Left margin between mapWidget and the game screen area
yourWidget:setMarginTop( yourWidgetTopMargin + mapWidgetMarginTop + gameScreenAreaMarginTop )
yourWidget:setMarginLeft( yourWidgetLeftMargin + mapWidgetMarginLeft + gameScreenAreaMarginLeft )
The problem is that, if you have view modes (since is OTClient, you can change your view mode with shortcut
Ctrl+.), it won't work for the full screen view mode.
It means that, in the full screen view mode, your widget would be below the left panel.
To fix that, you need to set a different margin left only for the full screen mode: for the top margin, exactly the top menu height + yourWidgetTopMargin; and, for the left margin, exactly the left panels width + yourWidgetLeftMargin.
Once you change back to non full screen view mode, you should back the previous top and left margins.
Good luck with that.