-- example code use your own
local screen
addEventHandler("onClientRender", root, function()
if not screen then return end
dxDrawImage(0, 0, 300, 300, screen)
end)
-- all magic done by calling dxUpdateScreenSource(screen, true) in onClientPreRender
local function screenPreRender()
if isElement(screen) then destroyElement(screen); screen = nil return end
local sx, sy = guiGetScreenSize()
screen = dxCreateScreenSource(sx, sy) -- your choice
if not isElement(screen) then return end
dxUpdateScreenSource(screen, true)
removeEventHandler("onClientPreRender", root, screenPreRender)
end
addEvent("getScreenShot", true)
addEventHandler("getScreenShot", resourceRoot, function()
addEventHandler("onClientPreRender", root, screenPreRender)
end)
triggerEvent("getScreenShot", resourceRoot)
This is example code. All magic done by screenPreRender function.