- Documentation
- Client functions
- dxCreateScreenSource
Function
dxCreateScreenSource
Creates a screen source of a given size. dxUpdateScreenSource writes the game image into it (scaled), which you then draw or process with a shader.
Syntax
element dxCreateScreenSource(int width, int height)Arguments
widthint- Width.
heightint- Height.
Returns
The source or false.
Example
local screen = dxCreateScreenSource(480, 270)
addEventHandler("onClientRender", root, function()
dxUpdateScreenSource(screen)
dxDrawImage(20, 20, 240, 135, screen)
end)
See also
dxUpdateScreenSourceRefreshes a screen source with the game image (without the script overlay). The image arrives 1-2 frames later.dxCreateShaderCreates a shader from a resource .fx file or from code given as a string. In Trilogy Hub a shader performs texture replacement: the image set withdxSetShaderValueunder a texture parameter replaces the world textures chosen withengineApplyShaderToWorldTexture(e.g. custom billboards, signs on buildings, car wraps). The game material stays (lighting, reflections); only the image changes. Pixel and vertex effects from HLSL code are not executed.