I will try to put a list of usefull function from the vanilla game.
-- Get position
ui:getX()
ui:getY()
ui:getRight() -- ui:getX() + ui:getWidth()
ui:getBottom() -- ui:getY() + ui:getHeight()
-- Get size
ui:getWidth()
ui:getHeight()
ui:setDrawFrame(false) -- remove the title bar
ui:bringToTop() -- put the ui in front of all the others
-- Find size of text
getTextManager():getFontHeight(UIFont.Small) -- get height of a font
getTextManager():MeasureStringX(UIFont.Small, "My text") -- get width in pixel of a text for a font
-- Screen size
getCore():getScreenWidth()
getCore():getScreenHeight()
-- Mouse position
getMouseX()
getMouseY()
-- Key
isShiftKeyDown() -- True if the shift key is down
isCtrlKeyDown() -- True if the ctrl key is down
getPlayerInfoPanel(0) -- The main vanilla panel (health, protection...)