DxIsAspectRatioAdjustmentEnabled: Difference between revisions
Jump to navigation
Jump to search
(Add example) |
Fernando187 (talk | contribs) (Remove obsolete Requirements section) Tag: Manual revert |
||
(3 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
{{New feature/item|3.0140|1.3.3|5547| | {{New feature/item|3.0140|1.3.3|5547| | ||
This function gets the current aspect ratio set by [[ | This function gets the current aspect ratio set by [[dxSetAspectRatioAdjustmentEnabled]]. | ||
}} | }} | ||
Line 12: | Line 12: | ||
===Returns=== | ===Returns=== | ||
*'''boolean:''' returns '''true''' when enabled by [[ | *'''boolean:''' returns '''true''' when enabled by [[dxSetAspectRatioAdjustmentEnabled]], '''false''' otherwise. | ||
*'''float:''' aspect ratio set by [[ | *'''float:''' aspect ratio set by [[dxSetAspectRatioAdjustmentEnabled]] | ||
==Example== | ==Example== | ||
This example will draw the aspect ratio to screen if aspect ratio was | This example will draw the aspect ratio to screen if aspect ratio was enabled previously. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler("onClientRender", root, function() | addEventHandler("onClientRender", root, function() | ||
dxSetAspectRatioAdjustmentEnabled(true) | |||
local enabled, ratio = dxIsAspectRatioAdjustmentEnabled() | local enabled, ratio = dxIsAspectRatioAdjustmentEnabled() | ||
Latest revision as of 17:17, 7 November 2024
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 enabled previously.
addEventHandler("onClientRender", root, function() dxSetAspectRatioAdjustmentEnabled(true) 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