DxUpdateScreenSource: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature|3.0110|1.1| Only available in 1.1 }} This function updates the contents of a screen source texture with the screen output from GTA...") |
m (Fix class name in OOP) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function updates the contents of a screen source [[texture]] with the screen output from GTA | This function updates the contents of a screen source [[texture]] with the screen output from GTA | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool dxUpdateScreenSource ( element screenSource ) | bool dxUpdateScreenSource ( element screenSource [, bool resampleNow = false ] ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[DxScreenSource]]:update}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''screenSource:''' The screen source element whose pixels we want to fill with the screen capture | *'''screenSource:''' The screen source element whose pixels we want to fill with the screen capture | ||
===Optional Arguments=== | |||
*'''resampleNow:''' 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=== | ===Returns=== | ||
Line 42: | Line 42: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Changelog== | |||
{{ChangelogHeader}} | |||
{{ChangelogItem|1.3.0-9.03795|Added resample argument}} | |||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} |
Latest revision as of 16:52, 14 May 2021
This function updates the contents of a screen source texture with the screen output from GTA
Syntax
bool dxUpdateScreenSource ( element screenSource [, bool resampleNow = false ] )
OOP Syntax Help! I don't understand this!
- Method: DxScreenSource:update(...)
Required Arguments
- screenSource: The screen source element whose pixels we want to fill with the screen capture
Optional Arguments
- resampleNow: 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
Returns true if the screen was successfully captured, false otherwise.
Example
This example will update the screen capture when F7 is pressed
addEventHandler("onClientResourceStart", resourceRoot, function() myScreenSource = dxCreateScreenSource( 500, 500) -- Create a screen source texture which is 500 x 500 pixels end ) bindKey( "F7", "down", function() if myScreenSource then dxUpdateScreenSource( myScreenSource ) -- Capture the screen end end ) addEventHandler( "onClientRender", root, function() if myScreenSource then dxDrawImage ( 0, 0, 300, 300, myScreenSource ) -- Draw the result in top left corner end end )
Changelog
Version | Description |
---|
1.3.0-9.03795 | Added resample argument |
See Also
- dxConvertPixels
- dxCreateFont
- dxCreateRenderTarget
- dxCreateScreenSource
- dxCreateShader
- dxCreateTexture
- dxDrawCircle
- dxDrawImage
- dxDrawImageSection
- dxDrawLine
- dxDrawLine3D
- dxDrawMaterialLine3D
- dxDrawMaterialPrimitive
- dxDrawMaterialPrimitive3D
- dxDrawMaterialSectionLine3D
- dxDrawPrimitive
- dxDrawPrimitive3D
- dxDrawRectangle
- dxDrawText
- dxDrawWiredSphere
- dxGetBlendMode
- dxGetFontHeight
- dxGetMaterialSize
- dxGetPixelColor
- dxGetPixelsSize
- dxGetPixelsFormat
- dxGetStatus
- dxGetTextSize
- dxGetTextWidth
- dxGetTexturePixels
- dxIsAspectRatioAdjustmentEnabled
- dxSetAspectRatioAdjustmentEnabled
- dxSetBlendMode
- dxSetPixelColor
- dxSetRenderTarget
- dxSetShaderValue
- dxSetShaderTessellation
- dxSetShaderTransform
- dxSetTestMode
- dxSetTextureEdge
- dxSetTexturePixels
- dxUpdateScreenSource