dxUpdateScreenSource
Client-side
Server-side
Shared
This function updates the contents of a screen source texture with the screen output from GTA.
OOP Syntax Help! I don't understand this!
- Method:dx-screensource:update(...)
Syntax
bool dxUpdateScreenSource ( dx-screensource screenSource, [ bool resampleNow = false ] )Required Arguments
- screenSource: The screen source element whose pixels we want to fill with the screen capture.
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- resampleNow (default: false): A bool to indicate if the screen should be captured immediately. The default is false which means the screen from the end of the previous frame is used (better for performance and consistency). Use true for layering fullscreen effects.
Returns
- bool: result
Returns true if the screen was successfully captured, false otherwise.
Code Examples
client
This example will update the screen capture when F7 is pressed.
local myScreenSource
addEventHandler("onClientResourceStart", resourceRoot, function() myScreenSource = dxCreateScreenSource(500, 500) -- Create a screen source texture which is 500 x 500 pixelsend)
bindKey("F7", "down", function() if myScreenSource then dxUpdateScreenSource(myScreenSource) -- Capture the screen endend)
addEventHandler("onClientRender", root, function() if myScreenSource then dxDrawImage(0, 0, 300, 300, myScreenSource) -- Draw the result in top left corner endend)Changelog
Added resampleNow argument.
See Also
Drawing Functions
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTargetUpdated
- dxCreateScreenSource
- dxCreateShader
- dxCreateTextureUpdated
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawModel3DNew
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsFormat
- dxGetPixelsSize
- dxGetStatusUpdated
- dxGetTextSize
- dxGetTexturePixelsUpdated
- dxGetTextWidth
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetShaderValue
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource