First thing to do is to create a texture shader. Just a simple one which will store your interface (dxCreateShader).
Then, you should make a render target (dxCreateRenderTarget) and draw all your interface in it (dxSetRenderTarget)
After that, calculations come in. Your 0;0 position is mid-screen. Specify how hard you want to rotate the shader: like -15 to 15 degrees. Do some math for degrees calculation:
local ox,oy = 0,0 -- We will use it for current offset
local mx,my = 15,15 -- 15 degrees for x and y position
local rt = dxCreateRenderTarget(sx,sy,true) --replace sx,sy with the size of the box
local shader = dxCreateShader(shaderfile) -- replace shaderfile with path to your texture shader
function updateRotation()
dxSetRenderTarget(rt)
-- Draw your interface here
dxSetRenderTarget()
dxSetShaderValue(shader,"texture",rt) -- Pass the render target to the shader
local px,py = getCursorPosition()
ox,oy = (px-0.5)*mx,(py-0.5)*my -- mid screen (0.5) will make 0 for ox,oy values. Others are relative
dxSetShaderTransform(shader,ox,oy) -- Here goes your main magic
-- And just draw your shader mid-screen here with dxDrawImage
end
addEventHandler("onClientRender",root,updateRotation) -- We wanna do it each frame, right?