dxCreateScreenSource
Client
Creates a screen source: an image that receives a copy of the game's screen on each dxUpdateScreenSource.
texture|nil dxCreateScreenSource(int width, height)
Parameters
| Name | Type | Description |
|---|---|---|
| width, height | int | Size in pixels, from 1 to 16384. The screen is stretched to fit. A vec2 also works. |
Returns
The screen source, or nil when the size is outside 1 to 16384 or it could not be created.
Example
local sx, sy = getScreenSize()
local screen = dxCreateScreenSource(sx / 4, sy / 4)
addEventHandler("onClientRender", root, function()
dxUpdateScreenSource(screen)
dxDrawImage(sx - sx / 4 - 20, 20, sx / 4, sy / 4, screen)
end)NoteOn failure it returns
nil, not false.