DxCreateScreenSource: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function creates a screen source, which is a special type of [[texture]] that contains the screen as rendered by GTA | This function creates a screen source, which is a special type of [[texture]] that contains the screen as rendered by GTA | ||
Line 12: | Line 9: | ||
element dxCreateScreenSource ( int width, int height ) | element dxCreateScreenSource ( int width, int height ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Texture|DxScreenSource]]}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''width :''' The width of the texture in pixels. | *'''width :''' The width of the texture in pixels. | ||
Line 43: | Line 40: | ||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} | ||
[[hu:dxCreateScreenSource]] |
Latest revision as of 10:38, 15 October 2018
This function creates a screen source, which is a special type of texture that contains the screen as rendered by GTA
Note that successful screen source creation is not guaranteed, and may fail due to hardware or memory limitations. You should always check to see if this function has returned false.
Syntax
element dxCreateScreenSource ( int width, int height )
OOP Syntax Help! I don't understand this!
- Method: DxScreenSource(...)
Required Arguments
- width : The width of the texture in pixels.
- height : The height of the texture in pixels.
Returns
Returns a texture element if successful, false if invalid arguments were passed to the function.
Example
addEventHandler("onClientResourceStart", resourceRoot, function() myScreenSource = dxCreateScreenSource ( 640, 480 ) -- Create a screen source texture which is 640 x 480 pixels end ) addEventHandler( "onClientRender", root, function() if myScreenSource then dxUpdateScreenSource( myScreenSource ) -- Capture the current screen output from GTA dxDrawImage( 50, 50, 100, 100, myScreenSource ) -- Now use myScreenSource as a material and draw it lots of times dxDrawImage( 150, 350, 150, 100, myScreenSource ) dxDrawImage( 250, 250, 100, 150, myScreenSource ) dxDrawImage( 350, 30, 150, 150, myScreenSource ) end end )
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