DxIsAspectRatioAdjustmentEnabled: Difference between revisions
Jump to navigation
Jump to search
(Fix links) |
(Add example) |
||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This example will draw the aspect ratio to screen if aspect ratio was set. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler("onClientRender", root, function() | |||
local enabled, ratio = dxIsAspectRatioAdjustmentEnabled() | |||
if(enabled) then | |||
dxDrawText("Aspect ratio is: " .. ratio, 250, 250) | |||
end | |||
end) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Drawing_functions}} | {{Drawing_functions}} |
Revision as of 01:26, 13 December 2019
This function gets the current aspect ratio set by DxSetAspectRatioAdjustmentEnabled.
Syntax
bool, float dxIsAspectRatioAdjustmentEnabled ( )
Returns
- boolean: returns true when enabled by DxSetAspectRatioAdjustmentEnabled, false otherwise.
- float: aspect ratio set by DxSetAspectRatioAdjustmentEnabled
Example
This example will draw the aspect ratio to screen if aspect ratio was set.
addEventHandler("onClientRender", root, function() local enabled, ratio = dxIsAspectRatioAdjustmentEnabled() if(enabled) then dxDrawText("Aspect ratio is: " .. ratio, 250, 250) 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