DxIsAspectRatioAdjustmentEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Add requirement)
(Remove obsolete Requirements section)
Tag: Manual revert
 
Line 14: Line 14:
*'''boolean:''' returns '''true''' when enabled by [[dxSetAspectRatioAdjustmentEnabled]], '''false''' otherwise.
*'''boolean:''' returns '''true''' when enabled by [[dxSetAspectRatioAdjustmentEnabled]], '''false''' otherwise.
*'''float:''' aspect ratio set by [[dxSetAspectRatioAdjustmentEnabled]]
*'''float:''' aspect ratio set by [[dxSetAspectRatioAdjustmentEnabled]]
==Requirements==
{{Requirements|n/a|1.3.3-9.05547}}


==Example==
==Example==

Latest revision as of 17:17, 7 November 2024

This function gets the current aspect ratio set by dxSetAspectRatioAdjustmentEnabled.

Syntax

bool, float dxIsAspectRatioAdjustmentEnabled ( )

Returns

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